webForumDet fria alternativet

XHTML/CSS pixelförskjutning

1 svar · 405 visningar · startad av webbebba

webbebbaMedlem sedan juni 200573 inlägg
#1

Min sida visas som tänkt i IE och Firefox men i Opera 8 och även på mac (IE, Safari, Opera) får jag en förskjutning på 1 px. Hur löser jag detta? Har försökt på olika sätt men jag löser inte problemet :x

http://w5.nuinternet.com/s550100337/sommarsidan/

body {background: #8C0C0C url(bilder/nybg.gif) repeat-y 50% 0; background-attachment: fixed; margin: 0; padding: 0;}
* {padding:0; margin:0;}
hr {display: none; clear:both;}
img {border: none;}

/* ---- IDs -------------------------------------------------------------------------------------------------------------*/
    
#wrapper {
	position: relative;
	width: 718px; 
	margin: 0 auto;
    }

#header {
	width: 718px; height: 250px;
	position: absolute;
	top: 0px; left: 0px;
	}
			
#left {
	width: 458px; height: 37px;
	position: absolute;
	top: 250px; left: 0px;
	background: url(bilder/left_1.gif) no-repeat;
	padding: 0 0 0 20px;
	}
		
#right {
	width: 259px;
	height: 37px;
	position: absolute;
	top: 250px;
	left: 459px;
	background: url(bilder/right_1.gif) no-repeat;
	}

#side { 
	width: 718px; 
	position: absolute;
	top: 250px; left: 0px;
	z-index: 2
	}
	
#sidemain {
	float: left; width: 458px;
	padding: 0;
	margin: 0;
	}

#content {
 	width: 458px;
 	}
 	
#contentimg {
	margin: 10px 0 10px 21px;
	padding: 0;
	}
 	
#content h1 {
    background: url(bilder/sippa.gif) no-repeat left;
	font-family: georgia, verdana, arial, sans-serif;
	font-size: 17px;
	font-weight: normal;
	color: #5F6F0C;
	margin: 5px 0px 5px 25px; padding: 0 0 0 25px;
	text-align: left;
	letter-spacing: 1px;
	}
	
#content h2 {
	font-family: georgia, verdana, arial, sans-serif;
	font-size: 17px;
	font-weight: normal;
	color: #695C4F;
	margin: 5px 0px 5px 25px;
	text-align: left;
	letter-spacing: 1px;
	}

#content p {
	font-family: verdana, arial, sans-serif;
	font-size: 11px;
	line-height: 18px; 
	color: #A16209;
	margin: 0px 25px 9px 25px;
	text-align: left;
	}
	
#content p a, 
#content p a:link, 
#content p a:active, 
#content p a:visited {
	color: #9B5F07;
	border-bottom: 1px solid #9B5F07;
	text-decoration: none;
	}
	
#content p a:hover {
	color: #766F64;
	text-decoration: none;
	border-bottom: 1px solid #766F64;
	}
	
#content ul {
	margin: 0 0 10px 25px;
	padding: 0;
	color: #955240;
	font-size: 12px;
	font-family: verdana, arial, sans-serif;
	}
	

	
	#content ul li {
	list-style: none;
	background: url(bilder/bullet.gif) no-repeat 5px 5px;
	margin: 0 ;
	padding: 0 0 8px 15px;
	line-height: 1.5em;
	}

	
#italicbox {
	width: 300px;
	padding: 15px 5px 15px 5px;	margin: 20px 0 20px 60px;
	font: italic normal 14px georgia, verdana, arial, Helvetica, sans-serif;
	color: #940A0A;
	text-align: center; line-height: 1.5em;
	background: #acd0dc;
	border-top: 1px solid #BFB4A3; border-bottom: 1px solid #BFB4A3;
	}
	
#meny { 	
	width: 259px;
	float: left;
	margin: 0; padding: 0;
 	}
 	
#meny h1 {
	font-family: georgia, verdana, arial, sans-serif;
	font-size: 15px;
	font-weight: normal;
	letter-spacing: .05em;
	color: #BE7815;
	margin: 0 0 4px 60px;
	padding: 0;
	}

#meny p {
	font-family: georgia, verdana, arial, sans-serif;
	font-size: 12px;
	color: #000;
	margin: 0px 20px 9px 20px;
	text-align: left;
	}
	
#meny ul {
	list-style: none;
	padding:0 0 0 21px; margin: 0 70px 12px 35px;
	font-family: georgia, verdana, arial, sans-serif;
	font-size: 12px;
	color: #787870;
	}

#meny li {
	margin: 0;
	padding: 0; 
	display: inline;
	}
	
#meny li a, 
#meny li a:link, 
#meny li a:active,
#meny li a:visited {
	height: 20px;
	margin: 0;
	display: block;
	color: #3E6A20; 
	text-decoration: none; 
	border-bottom: 1px solid #3E6A20;
	background: url(bilder/green.gif) no-repeat 2px 8px; 
	padding: 4px 0 0 12px;
	}
	

	
#meny li a:hover {
	color: #570606; 
	text-decoration: none; 
	border-bottom: 1px solid #168005;
	
	padding: 4px 0 0 12px;
	} 

#footer {
	background: #695C4F url(bilder/bgfooter-copy.gif);
	width: 693px; height: 25px;
 	clear: both;
 	font: 11px verdana, arial, sans-serif;
 	color: #BE7815;
 	padding: 15px 0 0 25px;
 	}
 #footer p {
margin: 0px 25px 9px 270px;}	
#footer a, 
#footer a:link,
#footer a:active,
#footer a:visited {
	color: #BB5C1C;
	border-bottom: 1px solid #BB5C1C;
	text-decoration: none;
	font-size: 10px;
	}
	
#footer a:hover {
	color: #766F64;
	text-decoration: none;
	border-bottom: 1px solid #766F64;
	}
	
/* ---- klasser -------------------------------------------------------------------------------------------------------------------------*/
	
.hrfix {
     background: url(bilder/hrbild.gif) no-repeat; 
	 width: 458px; 
	 height: 10px; 
	 margin: 35px 0px 20px 0px;}
.dekor {
     margin: 0; 
	 padding: 35px 0 15px 27px;}
.lthumbs {
     padding: 4px 5px 4px 4px;
     margin: 0 0 2px 20px; 
	 background-color: #ffffff;
	  border-top: #C2B931 1px solid;
     border-right: #C2B931 1px solid;
     border-bottom: #C2B931 1px solid;
	 border-left: #C2B931 1px solid;} 
.cthumbs {
     padding: 4px 5px 4px 4px; 
	 margin: 0 0 2px 2px; 
	 background-color: #ffffff;
	  border-top: #C2B931 1px solid;
     border-right: #C2B931 1px solid;
     border-bottom: #C2B931 1px solid;
	 border-left: #C2B931 1px solid;} 
.rthumbs {
     padding: 4px 5px 4px 4px; 
	 margin: 0 0 2px 2px; 
	 background-color: #ffffff;
	  border-top: #C2B931 1px solid;
     border-right: #C2B931 1px solid;
     border-bottom: #C2B931 1px solid;
	 border-left: #C2B931 1px solid;} 
.bigthumbs {
     padding: 4px 5px 4px 4px;
     margin: 0 20px 2px 80px; 
	 background-color: #acd0dc; 	
	 border-top: #C2B931 1px solid;
     border-right: #F4F2D2 1px solid;
     border-bottom: #F4F2D2 1px solid;
	 border-left: #C2B931 1px solid;}
.leftthumbs {
     padding: 4px 5px 4px 4px;
     margin: 0 30px 2px 70px; 
	 background-color: #acd0dc; 	
	 border-top: #C2B931 1px solid;
     border-right: #F4F2D2 1px solid;
     border-bottom: #F4F2D2 1px solid;
	 border-left: #C2B931 1px solid;}

.rightthumbs {
     padding: 4px 5px 4px 4px; 
     margin: 0 0 2px 2px;
	 background-color:#acd0dc;   
     border-top: #C2B931 1px solid;
     border-right: #F4F2D2 1px solid;
     border-bottom: #F4F2D2 1px solid;
	 border-left: #C2B931 1px solid;}
opera.jpg
jarvkloMedlem sedan juli 20013 378 inlägg
#2

Hmm...

Lite spekulation såhär på kvällskröken :)
Eventuellt kan problemet komma sig av att du positionerar bakgrundsbilden (nybg.gif) med "50% i sidled" i body, och lägger in headerbilder osv i wrappern (som centreras med margin:auto) - dvs du har två olika centreringsmetoder som var och en förmodligen avrundar pixelvärden utifrån fönstrets faktiska bredd på sitt eget sätt och utan koppling till varandra i de webbläsare du har problem med)

Blir det skillnad om du "tänker om" och lägger bakgrundsbilden i #wrapper istället (om det är möjligt för det du vill uppnå) för att s.a.s. lägga ut alla bilder utifrån samma grundstruktur/referenspunkt... ?

130 ms totalt · 3 externa anrop · v20260731065814-full.30151723
0 ms — hämta forumlista (cache)
0 ms — hämta statistik (cache)
127 ms — hämta tråd, inlägg och bilagor (db)