简体   繁体   English

为什么我的网站在mozilla firefox和chrome上看起来不同?

[英]Why does my website looks different on mozilla firefox and chrome?

I've been doing my html and i always open it using Mozilla Firefox. 我一直在做我的html,并且我总是使用Mozilla Firefox打开它。 It seems okay but when I open it with my localhost using Chrome, it looks different. 看起来还可以,但是当我使用Chrome使用本地主机打开它时,它看起来就不一样了。

This is the part that it went different: 这是它有所不同的部分:

<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>

This is the css part: 这是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;
}

The Problem is, that you are using <li> Elements without its enclosing <ul> elements. 问题是,您正在使用<li>元素而没有包含<ul>元素。 That it gets displayed correctly on firefox, is only a matter of luck. 在Firefox上正确显示它只是运气问题。

try using the <ul> elements, too, or remove your <li> tags. 也尝试使用<ul>元素,或删除您的<li>标记。

For more informations take a look at this question . 有关更多信息,请查看此问题 Here is the documentation of using <ul> or <ol> including <li> 这是使用<ul><ol>包括<li>文档

li does not work fine on different browsers without ul or li . li不无上不同的浏览器,做工精细ulli You should enclose this with ol or ul tags. 您应该使用olul标签将其括起来。 Here is an example 这是一个例子

 <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> 

Moreover, all browsers have a default styling for all HTML elements. 此外,所有浏览器的所有HTML元素均具有默认样式。 these elements are rendered based on default styling unless and until browser does not find styling for that element in CSS. 除非且直到浏览器在CSS中找不到该元素的样式,否则这些元素将基于默认样式呈现。 If you want to make the look of lists in both chrome and firefox, you will need to write CSS for the list and list items. 如果要在chrome和firefox中显示列表外观,则需要为列表和列表项编写CSS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 网站在mozilla firefox和chrome中看起来有所不同 - website looks different in mozilla firefox and chrome 为什么我的网站在chrome和firefox中的外观与使用flexbox的Safari中的外观不同? - Why does my website looks different in chrome and firefox than it does in Safari using flexbox? 我的网站在Firefox中的浏览器与Chrome浏览器不同 - My website looks different in Firefox from Chrome IE中的字体与Firefox和Chrome中的字体不同...为什么? - Font looks different in IE than it does in Firefox and Chrome…why? 网站 UI 在 safari 中看起来不太好,但在 chrome 和 firefox 中看起来很完美 - The website UI does not look fine in safari but looks perfect in chrome and firefox 我的网站在Firefox上看起来非常不同。无法查明原因 - My website looks very different on Firefox.. Can't pinpoint why 我在Mozilla Firefox中输入的日期与Google Chrome不同 - My input date in Mozilla Firefox is different with Google Chrome Inputbox在Firefox和Chrome中看起来有所不同 - Inputbox looks different in Firefox and Chrome 网站滑块在Google Chrome和Mozilla firefox上不起作用 - website slider is not working on Google Chrome and Mozilla firefox 当我在localhost上访问时,为什么我的复选框在chrome上看起来不同? - Why does my checkboxes looks different on chrome when I accessed it on localhost?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM