[英]Why does my website looks different on mozilla firefox and chrome?
我一直在做我的html,并且我总是使用Mozilla Firefox打开它。 看起来还可以,但是当我使用Chrome使用本地主机打开它时,它看起来就不一样了。
这是它有所不同的部分:
<div class ="label">
<li><a href="html/profiles.html"> Profiles</a></li>
<li><a href="html/expertise.html"> Expertise</a></li>
<li><a href="html/location.html"> Location</a></li>
</div>
这是CSS部分:
.label
{
display: inline-flex;
}
.label li a
{
margin-right: -433px;
margin-left: 490px;
text-decoration: none;
font-size: 20px;
list-style: none;
font-family:"Arial", Serif;
font-weight: bold;
color: #3b5998;
}
.label li{
list-style: none;
}
li
不无上不同的浏览器,做工精细ul
或li
。 您应该使用ol
或ul
标签将其括起来。 这是一个例子
<div class ="label"> <ul> <li><a href="html/profiles.html"> Profiles</a></li> <li><a href="html/expertise.html"> Expertise</a></li> <li><a href="html/location.html"> Location</a></li> </ul> </div>
此外,所有浏览器的所有HTML元素均具有默认样式。 除非且直到浏览器在CSS中找不到该元素的样式,否则这些元素将基于默认样式呈现。 如果要在chrome和firefox中显示列表外观,则需要为列表和列表项编写CSS。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.