Waiting for the master online! Page layout problem in HTML, how to align the lower ends of the two layers! _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:22:18
Original
1220 people have browsed it

Layout CSS HTML

I am not very talented and don’t know much about html and css. Now I am encountering the following problems when making a page. I hope experts can help me solve it!
[size=16px] In a page, I use layer layout. First, use layer 1 (height set to auto) to contain 2 and 3. Enter content in layers 2 and 3 respectively (these two layers are FLOAT:LEFT side by side). The problem I'm encountering now is that there is a list in layer 2 with relatively little content, so I set the height of layer 2 to auto; the content of layer 3 is mostly explanatory text on the page, so I set the height to auto. How to adjust the two layers so that the top is aligned and the bottom is aligned at the same time. And the content of layer 3 will change, sometimes more, sometimes less, so it is not very convenient to use a fixed height.
Please tell me the solution, thank you! ! ! size]

Reply to discussion (solution)

Why is no one replying? ?

Add the following css to layers 2 and 3: {padding-bottom:10000px;margin-bottom:-10000px;}

Thank you upstairs, but I think this still needs to be done according to the The size of the adjustment layer for different article lengths cannot be automatically aligned! Thank you anyway!

Use js and place it at the end of the page,
function fitHeight(){
div2.style.height=div3.style.height;
}
fitHeight();
In this way, the two divs will be realigned every time the page is loaded

Thank you upstairs, but I think this still requires adjusting the size of the layer according to different article lengths, and it cannot be automatically aligned! Thank you anyway! The article isn't that high, right? ? If you think 10000px is not enough, you can always write 10Wpx. The article shouldn't be that high. If this doesn't work, then you can only use JS. Compare the heights of the two layers and assign the larger height to the smaller div

Oh, thank you. I have to use JS! Ask for the code! Don’t know much about this!

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