我有以下HTML,中間居中居中div.logo
。CSS:在主div上放置一個盒子頂部
什麼是最簡單的跨瀏覽器解決方案,讓我把另一個框contactDetails
左或右,但保留居中圖像?
HTML:
<div id="page-wrap">
<header>
<div id="logo">
<img src="_assets/images/logo.png" width="500" height="518"/>
<h3>New Website Soon</h3>
</div><!--END logo-->
<div id="contactDetails">
<p>Content</p>
</div>
</header>
</div><!--END page-wrap-->
CSS:
*{
padding: 0;
margin: 0;
}
body{
background:url('../images/background.png') repeat;
margin: 0 auto;
}
div.page-wrap,header,div.logo,h1{
font-family: arial;
text-align: center;
margin:0;
}
div.page-wrap,header,div.logo,img{
border-radius: 5px;
}
div.contactDetails{
float: left;
margin: 0;
}
把聯繫方式立即*向右或向左,或在頁面的右側或左側邊緣? –
@RoddyoftheFrozenPeas我在想圖像和頁面邊緣的距離相等 –