English 中文(简体)
为什么在这次html中赢得一分之四,显示它是在停靠的其余部分之后的一栏:直线
原标题:Why won t first div in this html display as a column next to the rest of the html that is float:right
  • 时间:2012-01-16 01:19:11
  •  标签:
  • html
  • css

Why won t first div in this html display as a column next to the rest of the html that is float:right?

<div style="padding-top:20px; float:left; width:50%; clear:both">Column 1</div>
<div class="" style="padding-bottom: 10px; padding-right:20px; width: 50%; float:right; clear:both;">
  <label for="title">
    <h3 style="text-align:left">Column 2</h3>
  </label>
</div>
<div class="" style="padding-bottom: 10px; padding-right:20px; width: 50%; float:right; clear:both;">
  <input type="text" maxlength="255" value="">
</div>
<div class="" style="padding-bottom: 10px; padding-right:20px; width: 50%; float:right; clear:both;">
  <label for="body">
    <h3 style="text-align:left">Column 2</h3>
  </label>
</div>
<div class="" style="padding-bottom: 10px; padding-right:20px; width:50%; float:right; clear:both;">
  <textarea maxlength="60000"></textarea>
</div>

页: 1

http://jsfiddle.net/coder/UQXvC/

最佳回答

盒子的dding子的dding子增加了总宽。

a. 采用以下CSS:

.box {
    width: 50px;
    padding: 50px;
}

范围将达150px。


由于你把dding子重新添加到你的栏目中,它们实际上比50%大,并且可以再 fit。

问题回答

你应该把你们的 c子与你们的html分开。 当时试图做这样的事情。

#col1{
  float:left;
  width:50%;
{

#col2{
 float:left;
 width:50%
}

play play play play play play using 利用这些干::

<div id="col1"></div>
<div id="col2"></div>




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签