What Is DIV Tag
Hello Friends i recently found that some web programmers and designer not able to understand how to manage whole site in <div> tag. programmer and designer think that work with table format in web page is easier than div format. so i write this post for that guys and girls who afraid of with working div tags.
Please read this content carefully and create web page and web site in div tag.
1) DIV tag is a block-level element.
2) DIV tag can contain nearly any other tag.
3) DIV tag cannot be inside p tags.
4) DIV tag is not a replacement p tag. The p tag is for paragraphs,
only, while the DIV tag defines more general divisions within a document.
Don’t replace p tags with DIV tags.
5) It’s a good idea to label your DIV tags as you place them in your
document.
6) It’s always a good idea to close your DIV tags as soon as you open them.
Then place the contents within the element.
7) If you nest your DIV tags, be sure that you know where your content is
going (in other words, which DIV it should be part of).
The DIV element defines logical divisions within the document. This means
that when you use a DIV element, you are indicating that the enclosed
content is a specific section of the page. The DIV element is typically
used in XHTML+CSS documents to position portions of the page.
9) These are the tags are valid for DIV tag.”a, acronym, address, applet, b,
basefont, bdo, big, blockquote, br, button, center, cite, code, dfn, dir,
div, dl, em, fieldset, font, form, h1, h2, h3, h4, h5, h6, hr, i,
iframe,img, input isindex, kbd, label, map, menu, noframes, noscript,
object, ol, p, pre, q, s, samp, script, select, small, span, strike,
strong, sub, sup, table, textarea, tt, u, ul, var”.
10) My First Advice to all of you when you start to create your html layout in
to DIV tag first requirement is first of all you decide total portion of
html page create DIV tags for all that portion and give background
colors within it and after that create put your content in that portions
11) Second Advice for all that whatever you done in DIV tag please use Css
for that.
12) Also for SEO point of view you can set that Which portion In Code Is
appears first in layout and which is second rather than in display for
that you have to create CSS In that CSS Write Float: Left / Right whatever
you want First Please Give it.
13) If you want to give and DIV tag Center Align than Follow this simple
rule ”
” After that in CSS
.Container
{
Width: 900 px;
Margin: 0 auto;
}
14) One Note For Don’t Know anything about DIV tag is If you place two div
tag in same row than it will work like br tag mean second one DIV tag
Content will display in second row or say after first DIV Content but in
next row.
15) Another thing I suggest is please value for the id attribute must be used
only once on your page. It is a unique identifier.
16) Also another thing Keep in mind that the id value is case-sensitive.
“Top” is different from “TOP” and also different from “top” - it is
easiest to use all lower case letters.
17) Do not use spaces or any special characters as the id value. You may use
letters, digits (1 thru 9), dashes (-), and underscores (_) but you must
start the id value with a letter.
18) Also I Have to add One thing is internet Explorer and Firefox have
different approach to understand DIV tag so carefully design you site with
respects of both.
The Following Image Also Help you to how to create DIV Tag Style So Please
Refer it And also follow that way when create any web page.
•First Step: Create Page Like this with DIV Tag and Proper Ids.
•Keep Mind that Create One Mail Div Tag acting as container elements for
sub–elements, like paragraphs.
•Give position an element, or to place a border around an element.
•Our particular favorite for div elements is to use them as containers for a
block of h and p tags.
•After That Next thing is Decide Actual Size Of all the Div tags In that You
have to do Some Math Calculations For that Like This Way
•After that Create Step By Step Css Classes For All the DIV Tags and Place
Proper Content which you want with in all DIV Tag.
Advantages of DIV Over Table Format
•Better accessibility: for all navigators, search engines, machines,
handicapped persons.
•Duration: respecting standards will enable our websites to be compatible with
all future navigators.
•Update: the separation of the structure and content allows a higher
readability but also easier update process.
•Page weight: each HTML page weight is reduced by 1/3 to 2/3.
Disadvantages of Table Format
•Multiple imbrication of tables are often necessary, even for simple designs.
•Amount of tags (table, TR, TD, Column span, Row span) becomes huge and weighs
the code down, making it difficult to read and to update.
•Very heavy code generally lengthens the loading time for the pages.
Hello ! I am Arjun Jadeja a Software Engineer by Profession. You can contribute and I will distribute your ideas through this site. Thanks and Enjoy
One comment
Leave a reply