我的网站在Chrome中与其他浏览器的显示方式不同。我已经检查过IE,Firefox,Safari和Chrome。除了Chrome之外,一切都还不错。
看看CSS我不知道问题是什么。
它有3个相同大小的盒子,彼此相邻。左侧和中间框对齐,但右侧框在Chrome中高出20px。
这是方框的CSS:
#home_boxes {
margin: 20px 0 0 0;
clear: both;
width: 1000px;
overflow: hidden;
}
#home_boxes p {
margin-top: 0;
font-size: 10pt;
}
#home_boxes h2 {
margin-top: 0;
margin-bottom: 5px;
font-size: 14pt;
font-family: Verdana, Arial, Geneva, sans-serif;
}
#home_boxes .box_content {
width: 220px;
float: right;
padding: 5px;
}
#contact_box {
width: 318px;
min-height: 150px;
height: 100%;
background: url('../images/3box/contact.png') no-repeat #efefef;
float: left;
margin-right: 20px;
border: 1px solid #c9c9c9;
}
#contact_box:hover {
background: url('../images/3box/contact-hover.png') no-repeat #00529f;
border: 1px solid #c9c9c9;
color: #fff;
}
#about_box {
width: 318px;
min-height: 150px;
height: 100%;
background: url('../images/3box/about.png') no-repeat #efefef;
float: right;
margin-right: 20px;
border: 1px solid #c9c9c9;
}
#about_box:hover {
background: url('../images/3box/about-hover.png') no-repeat #00529f;
border: 1px solid #c9c9c9;
color: #fff;
}
#home_boxes #side_newsletter_box {
width: 320px;
background: url('../images/3box/newsletter.png') no-repeat;
overflow: hidden;
float: right;
}
#newsletter_box {
width: 318px;
min-height: 150px;
height: 100%;
background: url('../images/3box/newsletter.png') no-repeat #efefef;
float: right;
border: 1px solid #c9c9c9;
}
#newsletter_box:hover {
background: url('../images/3box/newsletter-hover.png') no-repeat #00529f;
border: 1px solid #c9c9c9;
color: #fff;
}
这是HTML:
<div id = "home_boxes">
<div id="newsletter_box">
<div class = "box_content">
<h2><?=get_content(610)?></h2>
<p><?=get_content(3234)?></p>
<form action = <?=$myroot?>"newsletter_process.php" method = "post">
<input type = "text" name = "email" class = "news_signup_input" value = <?=get_content(27)?> onClick = "this.value=''" />
<input type = "submit" name = "newsletter_submit" value = "" class = "news_signup_submit" />
</form>
</div>
</div>
<a href = "contact">
<div id = "contact_box">
<div class = "box_content">
<h2><?=get_content(1641)?></h2>
<p><?=get_content(3257)?></p>
</div>
</div>
</a>
<a href = "about">
<div id = "about_box">
<div class = "box_content">
<h2><?=get_content(3236)?></h2>
<p><?=get_content(3749)?></p>
</div>
</div>
</a>
</div>
有人可以看到问题。由于我不确定问题是什么,我一直在乱搞CSS一段时间但无济于事。我没有创建这个代码,我是从别人那里接过来的。
答案 0 :(得分:2)
就我意识到它的简单而言,在{3} div(clear
,newsletter_bos
,contact_box
)下面放置about_box
但在main
内(home_boxes
)div。
类似这样的事情
.clear {
clear: both;
line-height: 0%;
height: 0px;
display: block;
}
这可以解决您的问题并正确对齐所有方框。