HTML/CSS/CSS Attributes and Javascript Style Properties/margin right

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

margin-right: 15%

   <source lang="html4strict">

<html> <head> <title>Percentages Demo</title> <style type="text/css"> p {text-indent: -5%;

          margin-left: 25%;
          margin-right: 15%;
          font-size: 150%;

</style> </head> <body>

This paragraph"s font and margins have been set with percentages. The indent was set with a negative percentage.

</body> </html>

</source>
   
  


margin-right: auto

   <source lang="html4strict">

<!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: 2em;
           margin: 2em;
           border: thin solid black;
           width: 10em;
           margin-right: auto;
       }
           </style>
       </head>
       <body>

P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P
P

       </body>
   </html>
</source>
   
  


"margin-right" Example

   <source lang="html4strict">
   

<html> <head> </head> <body>

The following image has a right margin of 3mm.

<img src="http://www.wbex.ru/style/logo.png"

    height="50" 
    width="50" 
    style="margin-right="3mm"">

</body> </html>


     </source>