HTML div and span: Example (Code)

Formation HTML, tutoriel & guide de travaux pratiques en pdf.

DIV

• Purpose A i f l i h bl kl l l– A container for enclosing other block-level elements
• Attributes – align,style,class,id align, style, class, id
• Usage – Apply alignment or styles to multiple elements – Make a placeholder where Ajax results will be placed
• Differs from span in that span can only enclose inline elements, whereas div can enclose both block and inline Th
• The center tag – <div align= »center »>…</div> is equivalent to <center>…</center>
• div is allowed in both xhtml transitional and strict
• center is allowed only in xhtml transitional

div and span: Example (Code)

<body bgcolor= »#fdf5e6″> <p>Some text before the div</p> <p>Some text before the div</p> <div style= »border: inset; background-color: #cccccc; » align= »center »> <h2>Using div and span</h2> <h2>Using div and span</h2> <p>A list inside the div:</p> <ol> <li>List Item One</li> <li>List Item One</li> <li><span style= »background-color: yellow; »> List Item Two (inside span)</span></li> <li>List Item Three</li> st te ee / </ol> </div> <p>Some text after the div</p> p /p </body>

Cours gratuitTélécharger le cours complet

Télécharger aussi :

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *