Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,150,194 members, 7,807,659 topics. Date: Wednesday, 24 April 2024 at 04:56 PM

Importance Of Div Tags - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Importance Of Div Tags (1689 Views)

How To Do Vertical Alignment With Div-based Layouts / How To Style A Div Element / Enough Of Table Based Layouts: Time To Migrate To Css-div Layouts (2) (3) (4)

(1) (Reply)

Importance Of Div Tags by winexviv: 7:07am On Dec 27, 2012
Well basically the div tag says "do whatever other instructions are contained in the div tag until you see a </div> tag. div is only really useful in conjunction with another instruction.

for example <div align'"center">

aligns everything on center until there is a

</div>

The div tag is used to designate a block-line portion of an HTML document as a div element and to apply any of the core attributes of this tag against the contents of that element. The behavior of this tag is block-line, because this tag causes a line break (the equivalent of a br tag) to occur both before and after the div element. div tags, which can be nested, allow a significant degree of control and manipulation of each individual block section of your web page.

For example, you could use the class or style core attributes to apply the effects of Cascading Style Sheets, or you could use the lang attribute to display a foreign language text, or you could assign an id to each block of code for reference by a hyperlink.

In contrast, you should use the span tag when you want to apply attributes to an inline portion of a page. Note that the behavior of the span tag is not block-line, but rather inline, since the effects occur in the normal flow of the text and images (without the tag inserting any additional line-feeds or carriage returns).

With the advent of Cascading Style Sheets, both the div and span tags have gained importance and usefulness. The issue of cross-browser or mobile compatibility is being over rulled.
Re: Importance Of Div Tags by jamessmit(m): 9:42am On Dec 27, 2012
DIV Tag:
- Generally, It is supported in all major web browsers.
- It defines a division or a section in an HTML document.
- It is used to group block-elements to format them with CSS.
Re: Importance Of Div Tags by winexviv: 11:16am On Dec 27, 2012
james_smit: DIV Tag:
- Generally, It is supported in all major web browsers.
- It defines a division or a section in an HTML document.
- It is used to group block-elements to format them with CSS.
Nice one.

(1) (Reply)

How To Turn Gmail Into A Free Autoresponder! / How Can I Make Money From My Website That Has High Traffic? / Breaking News: Facebook Is Presently Down

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 9
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.