页面左侧的CSS空边距

时间:2010-11-09 13:41:28

标签: css margin

如何在页面左侧留空?屏幕截图位于http://jaakkospage.comyr.com/testi.php,CSS如下:

div.nav {
  text-align: center;
}

div.nav ul {
  background: #ADD8E6;
  border: 1px solid #999;
  display: inline-block;
  line-height: 2.5em;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  white-space: nowrap;
}

div.nav ul li {
  display: inline;
  margin: 0 1px;
  padding: 0;
}

div.nav ul li a {
  display: inline-block;
  padding: .5em;
  text-decoration: none;
  vertical-align: middle;
}

div.nav ul li a:hover {
  background-color: #48D1CC;
  color: #C0FFC0;
}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>  
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>     
<title>aaa</title>  <link type="text/css" rel="stylesheet" href="styles.css" /></head>  
<body> 
<div id="dokumentti">
<div class="nav">
<ul>
<li><a href="http://www.aaa.freehostingcloud.com/register.php">Rekisteröidy</a>  
</li><li><a href="http://www.aaa.freehostingcloud.com/login.php">Kirjaudu sisään</a>  
</li></ul>
</div>
</div>
</body>
</html>

1 个答案:

答案 0 :(得分:1)

#dokumentti {
    margin-left: 100px;
}