我有一个液态布局。 我需要 2 divs 水平相邻, 并使用全部可用的宽度 。 第二 div 必须是其内容的宽度, 因此第一 div 将会占用其余的空间 。
Here is my attempt: http://jsfiddle.net/jamesbrighton/N2prR/2/
除了# 按钮后面有其它背景外, 它的工作方式是 。 Im my actual site # other 右侧也有背景图像设置。 这意味着我需要背景颜色和图像, 才能扩展至 # 按钮, 而不是范围以外 。
我有一个液态布局。 我需要 2 divs 水平相邻, 并使用全部可用的宽度 。 第二 div 必须是其内容的宽度, 因此第一 div 将会占用其余的空间 。
Here is my attempt: http://jsfiddle.net/jamesbrighton/N2prR/2/
除了# 按钮后面有其它背景外, 它的工作方式是 。 Im my actual site # other 右侧也有背景图像设置。 这意味着我需要背景颜色和图像, 才能扩展至 # 按钮, 而不是范围以外 。
两者中的第1项均应浮动。 (如果没有,则存在于不同的“层次”和重叠中)
至于自动宽度问题, 我不认为您可以用 html 轻易做到。 在我的经验中, 它总是比较适合使用 设置的宽度/ 高度与 divs 一起工作 。
如果您想要的话, 您可以使用 2 td 表格( 一个设定为100%宽度, 另一个设定宽度 - 例如 200px)
祝你好运
<style>
#other {
background-color: blue;
width: 40%;
}
#button {
background-color: gold;
float: right;
border-radius: 10px;
width: 60%;
}
.clear{
clear: both;
}
<div id="parent"> <div id="button"> Submit Submit Submit Submit Submit Submit Submit Submit Submit Submit </div> <div id="other"> Some other content </div> <div class="clear"></div> </div>
您必须给第 1 & lt; div> 以百分比固定一些 。 第二段的文字会自动折叠 。
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....
I have a div <div id="masterdiv"> which has several child <div>s. Example: <div id="masterdiv"> <div id="childdiv1" /> <div id="childdiv2" /> <div id="...
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. ...
<form><input type="file" name="first" onchange="jsFunction(2);"> <input type="file" name="second" onchange="jsFunction(3);"</form> Possible to pass just numbers to the js ...
So I ve got a menu with a hover/selected state and it loads fine in IE6/IE7. However when I scroll down the page and put the element outside of the viewport and then back in I get a broken image! I ...
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 ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
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!