Home >Web Front-end >HTML Tutorial >float alignment problem_html/css_WEB-ITnose

float alignment problem_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:23:181341browse

<style type="text/css"><!--#content{width:1000px;margin:0 auto;clear:both;}.aaaa{width:745px;float:left;background-color:#0000FF;}.bbbb{width:745px;float:left;background-color: #00FF66;}.cccc{width:242px;float:left;background-color:#ff0000;}--></style><div id="content"><div class="aaaa">1111111</div><div class="bbbb">222222</div><div class="cccc">33333333</div></div>

Why is cccc not aligned with aaaa, but aligned with bbbb?


Reply to the discussion (solution)

Resolutely eliminate zero replies.

<div id="content"><div class="aaaa">1111111</div><div class="cccc">33333333</div><div class="bbbb">222222</div></div>


That’s it,

A total of 1000px

A total of 1000px a accounts for 745px b accounts for 745 c accounts for 242 a and b cannot occupy One line: Because there is not enough room, b comes down, and c cannot go up to align with a, so it aligns with b

Statement:
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