HTML/CSS/Box Model/min width

Материал из Web эксперт
Версия от 08:16, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

min-width:700px

 
<!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>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style>
body{
    background:#ccc;
    text-align:center;
}
#outer{
  width:80%;
  background:#aaa;
  margin:auto;
  text-align:left;
  position:relative;
  min-width:700px;
  border:1px solid #ccc;
}
h1{
    text-align:center;
}
p{
   padding:10px;
   margin:0 0 1em 0;
}
</style>
</head>
<body>
<div id="outer">
  <div id="inner">
    <div id="content">
      <h1>This is the title</h1>
      <p>this is a test. this is a test. this is a test. this is a test. </p>
      <p>This is the content : this is the content : 
      <p>This is the content : this is the content : his is the content : this 
        is the content : this is the content : this is the content : </p>
    </div>
  </div>
</div>
</body>
</html>



width: auto; min-width: 200px

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
        <head>
            <title></title>
            <style type="text/css">
        p {
            padding: 10px;
            margin: 10px;
            border: thin solid black;
            width: auto;
            min-width: 200px;
        }
            </style>
        </head>
        <body>
      <p>
          This is a test. This is a test. 
      </p>
        </body>
    </html>