Home > Web Front-end > HTML Tutorial > How to implement this adaptive layout? _html/css_WEB-ITnose

How to implement this adaptive layout? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:19:42
Original
1056 people have browsed it

The outer div is the same width as the browser (I know this), and it contains two divs, one on the left and one on the right. One div has a fixed pixel width, and the other has the remaining width (some pixels need to be margined). I know about float:left, but I don’t know how to write the remaining width at that time.
Cannot use js.


Reply to discussion (solution)

Use table

What I see

Use table
What I see is not using table, and now divs are generally used for layout.

For example, your left side is 120px. There are 2 elements on the page .left .right
The style is written like this
.left{float:left;width:120px;}
.right{margin-left:120px;width:100%;}

For example, your left side is 120px. There are 2 elements on the page .left .right
The style is written like this
.left{float:left;width:120px;}
.right{margin-left:120px;width:100%;}
I solved it myself, it's almost like this, but the key point is that the width of right is auto (just don't set it). If you do this, a horizontal scroll bar will appear. If you don't set it up, you can just use the remaining part.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template