I need help in centering one DIV withing a DIV.
我想有一辆汽车宽度的集装箱DIV,来接收整个屏幕宽度(称为其头盔)。
内部主管 集装箱,我想再增加三维:
- A Left DIV (400px wide)
- A Center DIV (100px wide)
- A right DIV (200px wide).
我直接希望DIV在屏幕中间。 现在,我只能把它放在左边和右DIV之间。
Thanks for any help.
I need help in centering one DIV withing a DIV.
我想有一辆汽车宽度的集装箱DIV,来接收整个屏幕宽度(称为其头盔)。
内部主管 集装箱,我想再增加三维:
我直接希望DIV在屏幕中间。 现在,我只能把它放在左边和右DIV之间。
Thanks for any help.
这一工作。
。headerContainer{
width:auto !important;
}
。leftDiv{
float:left;
width:400px;
}
。rightDiv{
float:right;
width:200px;
}
。centerDiv{
display:inline;
width:100px;
margin-left:auto;
margin-right:auto;
}
。
<div class="headerContainer">
<div class="leftDiv"></div>
<div class="centerDiv"></div>
<div class="rightDiv"></div>
</div>
你们可以做的是,在使双方平等的情况下,再增加一个四分之三,并设定了<条码>可见性:隐蔽性;条码>(而不是<条码>显示:无条码>);这样,它就会成为中间四分之一。
例如,在本案件中,有1@400px, 另有1 @ 100px, 另有1 @ 200px, 隐藏,@ 200px。
Regards, Richard
<div class="headerContainer">
<div class="leftDiv">left</div>
<div class="rightDiv">right</div>
<div class="centerDiv">center</div>
</div>
这一与该中心的超文本处理工作。 页: 1 缩略语
.headerContainer{
width:auto;
}
.leftDiv{
float:left;
width:400px;
background:pink;
}
.centerDiv{
width:100px;
/*
margin-left:auto;
margin-right:auto;
*/
margin:0 auto;
background:cyan;
}
.rightDiv{
float:right;
width:200px;
background:lightgray;
}
但是,如果屏幕上没有<代码>700px,那么你会得到一些总结。
http://jsfiddle.net/johnpa/9bN2p/“rel=“nofollow”>。 http://jsfiddle.net/johnpa/9bN2p/。
由于flex ,你可以使用现代解决办法。 cs3的概念。
.parent {
display: flex;
height: 300px;
/* Or whatever */
background-color: green;
}
.child {
width: 100px;
/* Or whatever */
height: 100px;
/* Or whatever */
margin: auto;
/* Magic! */
background-color: yellow;
}
<div class="parent">
<div class="child ">Div1</div>
</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!