我的网站在 Chrome 中加载正常,但在 Safari 中我的图片不会 float 到文章的左侧。下面是 CSS:
body {
background-color:white;
font-family: 'Josefin Slab', serif;
}
.top_portion {
width:820px;
height:200px;
background-color:#e2e2e2;
margin:auto;
text-align:center;
border-top:5px;
border-bottom:5px;
border-left:0px;
border-right:0px;
border-style:solid;
border-color:#30474b;
}
.top_portion img {
padding-top:0px;
}
#welcome h1 {
margin-top:0px;
text-align:center;
padding:0px;
margin-bottom:0px;
}
#welcome h3 {
margin:0px;
text-align:center;
}
#welcome {
margin:auto;
background-color:#e2e2e2;
width:820px;
}
#navigation {
text-align:center;
}
#navigation li {
list-style-type:none;
display:inline;;
}
ul {
font-size:20px;
margin:0;
}
ul a {
padding-right:20px;
text-decoration:none;
color:black;
}
a:hover {
color:#888eee;
}
这是包含图片和文章的div
.info {
width:820px;
margin:auto;
background-color:#e2e2e2;
overflow:hidden;
}
这是图片
.info img {
padding-top:6px;
padding-left:5px;
}
这是这篇文章,上面的 .info img 应该彼此相邻,但它们不在已更新到最新版本的 Safari 中。
article {
padding-left:5px;
font-family:sans-serif;
text-indent:15px;
width:600px;
float:right;
background-color:#e2e2e2;
display:inline-block;
text-align:justify;
}
article h2 {
font-family: 'Carme', sans-serif;
margin-top:5px;
}
h5 {
padding:0;
margin:0;
}
a {
color:black;
}
#bottomlink {
font-size:1.5em;
text-align:center;
}
#bottomlink a {
text-decoration:none;
}
最佳答案
float :左;对于 img 不要打扰 float:right;关于文章
关于css - 为什么在 Safari 中我的图像不会 float 到我段落的左侧,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21518487/