居中两个并排div
问题描述:
我有点生锈与CSS,我卡住了这一点,我想实现的是有两个div并排与图像重叠的两个顶角,这我有多少事(希望正确),有什么我坚持做的是试图中心的两个并排侧的div我现在不能做没有打破它居中两个并排div
任何帮助将是巨大的,谢谢
<style>
#wrapper {
margin:0 auto;
height:auto;
overflow: hidden; /* add this to contain floated children */
}
#first {
width: 300px;
float:left; /* add this */
color:#FFF;
padding:0 5px 5px 5px;
background: url(view.image?id=598) 0 100% #fcb033 no-repeat;
}
#second {
width: 300px;
float: left;
padding:0 5px 5px 5px;
color:#FFF;
background: url(view.image?id=595) 100% 100% #c1d72e no-repeat;
}
#overlayleft{
position:absolute;
top:-40px;
left:-30px;
}
#overlayright{
position:absolute;
top:-40px;
left:570px;
}
</style>
<div id"wrapper">
<div id="first"><div id="overlayleft"><img alt="Dr Sayer" height="94" src="view.image?Id=592" width="93" /></div><h1 style="text-align:right">Dr John Sayer</h1><p>Cystic kidney diseases, such as polycystic kidney
disease (PKD), are responsible for ten per cent of
patients requiring dialysis and transplantation in
the UK. As with most cystic kidney diseases, PKD
is a genetic condition which causes fluid-filled
sacks to develop on the interior and exterior of
the kidneys. These sacks gradually replace normal
kidney tissue, enlarging the organs and reducing
their ability to function – eventually causing them
to fail altogether. A recently discovered gene,
involved in the onset of cystic kidney diseases,
has provided a basis for the work of Dr John Sayer.
Dr Sayer is studying this specific gene closely and
hopes not only to improve our understanding of
the molecules which cause cystic kidney diseases,
but also test potential new drug treatments aimed
at preventing the formation of cysts.</p></div>
<div id="second"><div id="overlayright"><img alt="Donate" height="94" src="view.image?Id=592" width="93" /></div><h1>Carol Norbury</h1>
<p>Carol Norbury’s family has a prolonged history of polycystic
kidney disease. Her husband, John, was diagnosed with the condition in 1996, before
going on to suffer complete renal
failure in late 2004. Luckily, Carol
was found to be a suitable organ
donor. However, since then, each
of Carol and John’s three children
has been diagnosed with
the condition.</p></div>
<div class"clear"></div>
</div>
答
您必须在“margin:0 auto;”的包装器上指定宽度上班。
,你就错过了等号在包装标识