當我在Windows中查看網站時,大部分網站(如頂部文本,右側聯繫人詳細信息,導航文本和歡迎文字)都顯示爲比在Mac上更低。 Mac瀏覽器顯示CSS應該是。請幫我...CSS在Windows上顯示的不同於Mac
Mac的屏幕截圖
的Windows截圖
HTML
<body>
<div id="wholepage">
<header>
<div id="nav_top">
<nav>
<h1 class="slogan">Steel & Fabrication Specialists</h1>
</nav>
</div>
<a href="index.html"><img class="kks_logo" src="KKSLogo.png" border="0" alt="KKS Services Ltd logo"></a>
<h1 class="logo">KKS</h1>
<h2 class="logosub">Services Ltd</h2>
<h3 class="head_contact">0113 2826946</h3>
<h3 class="head_contact"><a href="contact.html">[email protected]</a></h3>
<nav id="main_nav">
<ul id="nav_main">
<li><a class="current_index" href="index.html">HOME</a></li>
<li><a class="domestic" href="domestic.html">DOMESTIC</a></li>
<li><a class="automation" href="automation.html">AUTOMATION</a></li>
<li><a class="commercial" href="commercial.html">COMMERCIAL</a></li>
<li><a class="contact" href="contact.html">CONTACT</a></li>
</ul>
</nav>
<img class="rivot" src="rivot.png" alt="KKS Services Ltd Rivot"/>
<img class="rivot2" src="rivot.png" alt="KKS Services Ltd Rivot"/>
<img class="rivot3" src="rivot.png" alt="KKS Services Ltd Rivot"/>
<img class="rivot4" src="rivot.png" alt="KKS Services Ltd Rivot"/>
</header>
<section>
<article>
<img class="railings" src="index_rail.png" alt="KKS Services Gates and Railings"/>
<div id="welcome">
<h1 class="welcome">Welcome</h1>
CSS
.slogan{
position: relative;
width: 960px;
margin-left: auto;
margin-right: auto;
left: 10px;
top: -5px;
color: white;
font-size: 1.3em;
font-family: 'Aldrich', cursive;
}
.kks_logo{
position: relative;
top: 50px;
}
.head_contact{
font-family: 'Aldrich', sans-serif;
position: relative;
left: 10px;
top: -175px;
font-size: 1.5em;
text-align: right;
}
ul#nav_main li{
display: inline;
padding: 26px;
}
ul#nav_main li a{
text-decoration: none;
color: white;
font-family: 'Aldrich', sans-serif;
font-size: 1.4em;
position: relative;
top: 13px;
}
#welcome{
position: relative;
top: -267px;
left: 70px;
width: 840px;
height: 35px;
background-color: rgba(0,0,0,0.6);
border-radius: 5px;
}
#welcome h1{
color: white;
font-family: 'Aldrich', sans-serif;
padding: 10px;
font-size: 200%;
position: relative;
top: -5px;
left: 10px;
}
謝謝!
這就是爲什麼你不應該使用絕對和/或相對定位的一切......爲了解決這個問題,你就需要要麼重新構造你的CSS(推薦)或使用媒體查詢和/或Javascript進行補償。 –
好的,就重構CSS代碼而言,您會推薦最好的東西來代替相對和絕對位置嗎? – kwright2713
您是否重置默認瀏覽器規則?您在每個系統上使用哪些瀏覽器? – Shomz