HTML/CSS/CSS Attributes and Javascript Style Properties/width

Материал из Web эксперт
Перейти к: навигация, поиск

width: 250px

 
<!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 {
            margin: 10px;
            padding: 10px;
            color: black;
            border: thin solid;
            width: 250px;
            top: 100px;
            line-height: 3em;
            font-size: 1em;
        }
            </style>
        </head>
        <body>
      <p>
this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. 
this is a test. this is a test. this is a test. this is a test. 
      </p>
        </body>
    </html>



"width" Example

    
<html>
<body>
<img id="myImg" 
     src="http://www.wbex.ru/style/logo.png" 
     width="132">
<br>
<input type="button" value="Shrink image" onclick="myImg.style.width="65"">
<input type="button" value="Restore image" onclick="myImg.style.width="132"">
</body>
</html>