Challenge:
Creating a two-column layout where the right column has a fixed width while the left column dynamically adjusts to the available space.
Code Provided:
The code provided attempts to implement the layout using float and margin, but encounters issues.
Solution:
To establish a fixed-width right column while maintaining fluidity in the left column, follow these guidelines:
Example Code:
HTML:
Right content with fixed widthLeft content with flexible width
CSS:
.container { height: auto; overflow: hidden; } .right { width: 180px; float: right; background: #aafed6; } .left { float: none; background: #e8f6fe; width: auto; overflow: hidden; }
Demo:
Visit [this JsFiddle](https://jsfiddle.net/jackJoe/fxWg7/) for a working demonstration.
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3