无法将Div放置在另一个左浮动Div的右侧 [英] Can't position a Div to the right of another left floated Div
问题描述
大家好,
我制作了一个简单的Div,它留下了浮动,我现在试图将另一个Div放在那个区域的右边。
I made a simple Div that is left floated and am trying to now place another Div to the right of that one.
#left-form {
float:left;
width:400px;
background-颜色:#FFFF00;
填充:0px;
保证金:0px;
}
#left-form {
float: left;
width: 400px;
background-color: #FFFF00;
padding: 0px;
margin: 0px;
}
当我将光标定位在浮动Div的右侧并双击以添加新的Div时,它会将其置于下方而不是内联。
WTH?
When I position the cursor to the right of the floated Div and double click to add a new Div it places it below not inline. WTH?
我没有找到发布屏幕截图的方法。
I don't see a way to post a screen shot or I would.
问候
Lee
推荐答案
在为新div指定宽度之前,它默认为 所有 块元素 - 为自己指定100%的宽度并开始一个新行。如果两个div的容器宽度为960px,请创建新div,然后为其分配
560px或更小的宽度,并且它应该在另一个旁边向上滑动。
Until you assign the new div a width, it does as all block elements do by default—assigns itself a width of 100% and starts a new line. If your container for both divs is 960px wide, create the new div, then assign it a width of 560px or less, and it should slide up right beside the other one.
FWIW,在设计视图中创建布局并不是一个好主意。 EW不是WYSIWYG应用程序。只是说'... ; - )
FWIW, creating layouts in design view is not a great idea. EW is NOT a WYSIWYG application. Just sayin'... ;-)
欢呼,
scott
cheers,
scott
这篇关于无法将Div放置在另一个左浮动Div的右侧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!