Jag vill få denna koden att fungera i fler internet-klienter än Internet Explorer. Blanda inte olika positioneringsmetoder. På .inv_armor använder du just nu absolut positionering, medan du på .inv_weap förlitar dig till marginalangivelser. Kan inte så mycket om css, därför använde jag mig av class. Visste inte att man kunde skriva på detta sättet. > <b>Vad är det för skillnad på class och id då?</b>Få CSS-kod att fungera i mer än IE
    
    
Allt hamnar snett i både Mozilla och Opera.
Vad borde jag ändra?
css
<code>body {
	background-color: #000000;
	font-family: verdana,helvetica,sans-serif;
	font-size: 12px;
	color: #cccccc;
}
.top {
	margin-top: 0px;
	background-color: #000000;
	font-size: 14px;
}
.player_stats {
	width: 150px;
	float: left;
	margin-top: 10px;
	background-color: #000000;
	font-size: 12px;
}
.main {
	width: 500px;
	margin-top: 10px;
	margin-left: 10px;
	background-color: #000000;
	font-size: 12px;
}
.inv_helm {
	width: 100px;
	margin-left: 200px;
	background-color: #982748;
}
.inv_weap {
	width: 100px;
	margin-top: 50px;
	background-color: #982748;
}
.inv_armor {
	position: absolute;
	top: 106px;
	left: 262px;
	width: 100px;
	margin-left: 100px;
	background-color: #982748;
}
.inv_shield {
	position: absolute;
	top: 106px;
	left: 463px;
	width: 100px;
	margin-left: 100px;
	background-color: #982748;
}
.inv_gloves {
	position: absolute;
	top: 206px;
	width: 100px;
	background-color: #982748;
}
.inv_belt {
	position: absolute;
	top: 206px;
	left: 262px;
	width: 100px;
	margin-left: 100px;
	background-color: #982748;
}
.inv_boots {
	position: absolute;
	top: 206px;
	left: 463px;
	width: 100px;
	margin-left: 100px;
	background-color: #982748;
}
a {
	text-decoration: none;
	font-size: 12px;
	color: #cccccc;
}</code>
html
<code><div class="top"> 
   <?php 
   include("top.php"); 
   ?> 
</div> 
 
<div class="player_stats"> 
      <?php 
      include("player_stats.php"); 
      ?> 
</div> 
    
<div class="main"> 
   <div class="inv_helm"> 
         helm 
   </div> 
    
   <div class="inv_weap"> 
      weapon 
   </div> 
       
   <div class="inv_armor"> 
      armor    
   </div> 
       
   <div class="inv_shield"> 
      shield    
   </div> 
       
   <div class="inv_gloves"> 
      gloves 
   </div> 
    
   <div class="inv_belt"> 
      belt 
   </div> 
    
   <div class="inv_boots"> 
      boots 
   </div>    
</div></code>
Blev rätt mycket kod, hoppas ni orkar gå igenom det :/Sv: Få CSS-kod att fungera i mer än IE
    
    
Varför använder du förresten class när det borde vara lämpligare att använda id? Du skall väl inte ha fler element som heter t.ex. inv_weap?
Edit:
Så här...
<code>
<style type="text/css">
body {
    background-color: #000000;
    font-family: verdana,helvetica,sans-serif;
    font-size: 12px;
    color: #cccccc;}
#main {
    position: relative;
    top: 0px;
    left: 0px;
    width: 500px;
    background-color: #000000;
    font-size: 12px;
}
#inv_helm, #inv_weap, #inv_armor, #inv_shield, #inv_gloves, #inv_belt, #inv_boots {
    position: absolute;
    width: 100px;
    background-color: #982748;
}
#inv_helm {
    top: 0;
    left: 300px;
}
#inv_weap {
    top: 100px;
    left: 100px;
}
#inv_armor {
    top: 100px;
    left: 300px;
}
#inv_shield {
    top: 100px;
    left: 500px;
}
#inv_gloves {
    top: 200px;
    left: 100px;
}
#inv_belt {
    top: 200px;
    left: 300px;
}
#inv_boots {
    top: 200px;
    left: 500px;
}
a {
    text-decoration: none;
    font-size: 12px;
    color: #cccccc;
}
</style>
    
<div id="main"> 
   <div id="inv_helm"> 
         helm 
   </div> 
    
   <div id="inv_weap"> 
      weapon 
   </div> 
       
   <div id="inv_armor"> 
      armor    
   </div> 
       
   <div id="inv_shield"> 
      shield    
   </div> 
       
   <div id="inv_gloves"> 
      gloves 
   </div> 
    
   <div id="inv_belt"> 
      belt 
   </div> 
    
   <div id="inv_boots"> 
      boots 
   </div>    
</div>
</code>Sv:  Få CSS-kod att fungera i mer än IE
    
    
Det funkar. Tack.Sv:   Få CSS-kod att fungera i mer än IE
    
    
ID sätts på ett unikt objekt och CLASS kan användas på flera objekt.