Witam,
Niedawno rozpocząłem swoją przygodę z CSSami i niestety jak zapewne każdy rozpoczynający swoją przygodę mam problem z dopasowaniem wyglądu dla kilku różnych przeglądarek. Obecnie testuję stronę na IE8 oraz Chrome.
Problem stanowi bowiem szerokość
div#menu ul li a:link, ul li a:visited oraz
div#menu ul li a:hover. W przypadku IE8 width: 200px wyśmienicie spełnia swoje zadanie, natomiast w przypadku Chrome przy ustawionym width:200 (pewnie z powodu left-border oraz padding) szerokosc menu jest w rzeczywistosci duzo większa i wpada na div="menu".
body {
background: rgb(240,240,240);
font-family: Arial, Helvetica, Verdana, Sans-serif;
font-size: 12px;
}
div#container{
width:800;
background: white;
margin: auto;
display: block;
}
div#header{
height: 220px;
background: red;
}
div#menu_header{
font-family: Verdana;
font-size: 15px;
font-weight: bold;
padding: 2px 0 0 0;
color: white;
text-align: center;
text-transform: uppercase;
width:200px;
height:20px;
background: #006400;
float: left;
clear: left;
-webkit-border-top-left-radius: 10px;
-webkit-border-top-right-radius: 10px;
-khtml-border-radius-topright: 10px;
-khtml-border-radius-topleft: 10px;
-moz-border-radius-topright: 10px;
-moz-border-radius-topleft: 10px;
border-top-right-radius: 10px
border-top-left-radius: 10px;
}
div#menu{
background: white;
float: left;
clear:left;
width:200px;
}
div#menu ul{
width:200px;
color: white;
font-weight: bold;
margin: 0;
padding: 0;
}
div#menu ul li{
border-bottom: 1px solid #9ce;
list-style: none;
}
div#menu ul li a:link, ul li a:visited{
display: block;
width: 200px;
text-decoration: none;
padding: 7px;
font-weight: bold;
background-color: #27c;
color: #def;
border-left: 10px solid #25b;
}
div#menu ul li a:hover{
width: 200px;
background-color: orange;
color: #fff;
border-left: 20px solid #26d;
}
div#down_menu_header{
font-family: Verdana;
font-size: 15px;
font-weight: bold;
padding: 2px 0 0 0;
color: white;
text-align: center;
text-transform: uppercase;
margin-top: 30 px;
width:200px;
height:20px;
background: #006400;
float: left;
clear: left;
-webkit-border-top-left-radius: 10px;
-webkit-border-top-right-radius: 10px;
-khtml-border-radius-topright: 10px;
-khtml-border-radius-topleft: 10px;
-moz-border-radius-topright: 10px;
-moz-border-radius-topleft: 10px;
border-top-right-radius: 10px
border-top-left-radius: 10px;
}
div#down_menu{
width:200px;
height:100px;
background: rgb(255,180,0);
float: left;
clear: left;
}
div#content{
background: white;
margin-left: 200px;
padding: 15px;
line-height: 18px;
}
div#footer{
height: 30px;
background: rgb(255,180,0);
font-family: Tahoma, Arial, Helvetica, Sans-serif;
font-size: 10px;
color: white;
clear: both;
-webkit-border-bottom-left-radius: 8px;
-webkit-border-bottom-right-radius: 8px;
-khtml-border-radius-bottomright: 8px;
-khtml-border-radius-bottomleft: 8px;
-moz-border-radius-bottomright: 8px;
-moz-border-radius-bottomleft: 8px;
border-bottom-right-radius: 8px
border-bottom-left-radius: 8px;
}
div#footer div#altnav{
width: 350px;
float: right;
text-align: right;
}
div#footer a {
color: white;
text-decoration: none;
}
div#footer a:hover {
color: red;
}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<META NAME="Generator" CONTENT="EditPlus"> <META NAME="Author" CONTENT=""> <META NAME="Keywords" CONTENT=""> <META NAME="Description" CONTENT=""> <link rel="stylesheet" href="tmp.css" type="text/css"> <script src="IEmarginFix.js" type="text/javascript"></script>
MENU:
<li><a href="#">Czcionki
</a></li> <li><a href="#">Tekst
</a></li> <li><a href="#">Marginesy
</a></li> <li><a href="#">Obramowanie
</a></li>
<div id="down_menu_header"> KONTAKT:
TEKST
Copyright by
<a href="#"> XYZ
</a> <a href="#">Services
</a> -
<a href="#">Portfolio
</a> -
<a href="#">Contact Us
</a> -
<a href="#">Terms of Trade
</a>
Mam nadzieję, że problem przedstawiłem wystarczająco jasno

.
Z góry bardzo dziękuję za pomoc.
Pozdrawiam
Jacek
Ten post edytował sslackware 25.07.2010, 18:41:36