Tutorial HTML - Div

  »   Tag-uri speciale  »   Tutoriale HTML - Tagul DIV

Tagul div este nu este altceva decat un suport pentru alte taguri. Iata cateva atribute ale acestui tag:

  • id
  • title
  • style
  • height
  • width

Restul atributelor nu se folosesc in general functiile lor fiind cedate CSS-ului.

Iata si un exemplu de folosire a tagului <div>:

html<div id="menu" align="right" >
	<a href="#">HOME</a> | <a href="#">CONTACT</a> | <a href="#">ABOUT</a>
</div>

<div id="content" align="left" bgcolor="white">
	<h4>Titlu Aici </h4>
	<p>The div tag is a non-visual (by default) element that can be used to apply additional properties to content contained within it. Unlike the span tag</p>
</div>

Demo

Titlu Aici

The div tag is a non-visual (by default) element that can be used to apply additional properties to content contained within it. Unlike the span tag

Tagul div este mult mai usor de folosit decat tagul table, de aceea este recomandabil si preferabil, folosirea lui ori de cate ori este nevoie.

Tagul Div - usurinta in modificare

Unul dintre motivele pentru care este usor de folosit este introducerea noilor date cu facilitate si vom si exemplifica acest locru.

In exemplul urmator am adaugat cateva campuri noi paginii exemplificate mai sus.

html<div align="right" >
	<a href="#">HOME</a> | 
	<a href="#">CONTACT</a> | 
	<a href="#">ABOUT</a> |
	<a href="#">SITEMAP</a>
</div>

<div align="left" >
	<h4>Titlu Aici</h4>
	<p>An HTML tag that is widely used to break apart a Web page into elements, each with its own layout attributes. The SPAN tag is somewhat similar to DIV, except that SPAN defines a small amount of text, whereas DIV defines an entire block of data on the page.</p>
	<h4>Titlu 2 Aici</h4>
	<p>The Div macro wraps content in a div tag with optional class and styles.   The div tag is a non-visual (by default) element that can be used to apply additional properties to content contained within it. Unlike the span tag</p>
</div>

Demo

Titlu Aici

An HTML tag that is widely used to break apart a Web page into elements, each with its own layout attributes. The SPAN tag is somewhat similar to DIV, except that SPAN defines a small amount of text, whereas DIV defines an entire block of data on the page.

Titlu 2 Aici

The Div macro wraps content in a div tag with optional class and styles. The div tag is a non-visual (by default) element that can be used to apply additional properties to content contained within it. Unlike the span tag