2010-04-27 8 views
0

Je voulais donc jouer avec Sass alors j'ai créé cette petite page incroyablement simple. Pour des raisons que je ne connais pas lorsque j'ajoute une marge supérieure à #content, cela affecte plutôt mon div wrapper. Toute information sur ce qui se passe serait grandement appréciée. Merci!Problèmes de formatage css

Voici la page en direct: http://cheapramen.com/omg/

html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 

<head> 
<link rel="stylesheet" href="stylesheets/screen.css" type="text/css" media="screen" /> 



<title>YO</title> 

</head> 

<body> 

<div id="wrapper"> 

<div id="content"> 

<div class="dog"> 
Bury me with my money 
</div> 

</div> 






</div> 
</body> 
</html> 

Sass

html body 
    background-color: #000 
    padding: 0 
    margin: 0 
    height: 100% 

#wrapper 
    background-color: #fff 
    width: 900px 
    height: 700px 
    margin: 0 auto 

#content 
    width: 500px 
    margin: 150px 0 0 50px 

.dog 
    color: #FF3836 
    font-size: 25px 
    text-shadow: 2px 2px 2px #000 
    width: 500px 
    height: 500px 
    -moz-border-radius: 5px 
    -webkit-border-radius: 5px 
    border: 18px solid #FF3836 

Css que le Sass crache sur

html body { background-color: #000; padding: 0; margin: 0; height: 100%; } 

#wrapper { background-color: #fff; width: 900px; height: 700px; margin: 0 auto; } 

#content { width: 500px; margin: 150px 0 0 50px; } 

.dog { color: #FF3836; font-size: 25px; text-shadow: 2px 2px 2px #000; width: 500px; height: 500px; -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 18px solid #FF3836; } 

Répondre

0

Vous avez fait co justement. La chose qui vous manque est float: left. Changez votre ligne à ceci:

#content { width: 500px; margin: 150px 0 0 50px; float: left; } 
+0

@Davey Avez-vous déjà essayé? – orokusaki