dcsimg
www.webdeveloper.com
Results 1 to 13 of 13

Thread: When should we use DIV Tag in HTML?

  1. #1
    Join Date
    May 2014
    Location
    India
    Posts
    23

    When should we use DIV Tag in HTML?

    Hi Everyone,

    I know about HTML but I always confused about DIV tag. I want to know when should I use DIV tag in web page designing using HTML. Can anyone explain it?
    Share on Google+

  2. #2
    Join Date
    Apr 2014
    Location
    Burnley uk
    Posts
    70
    You can use div every where you want to use without worrying. Div can be for any propose. for creating containers, for creating list items. but its against the w3c standards. For better info about div tag you should visit the following link

    http://www.w3schools.com/tags/tag_div.asp
    Share on Google+

  3. #3
    Join Date
    Jun 2014
    Posts
    27
    In general the DIV tags are used to bind the contents and the contains. You can use the DIV tag to show the design of you web page look goods. Also it can be use in the form and lists. There are many places you can use the DIV tag along with css to make the UI better and attractive.
    Share on Google+

  4. #4
    Quote Originally Posted by drwebsitesuk View Post
    For better info about div tag you should visit the following link
    No, no they shouldn't... since W3Schools has absolutely nothing to do with the W3C, is filled with incomplete and misleading information, and on the whole is a bunch of halfwit garbage.

    See: http://www.w3fools.com

    Or not... huh... site is down.

    In any case, DIV and SPAN are both simple -- they are 'semantically neutral' containers, which is to say they do not impart meaning to what you are wrapping other than "This MAY receive an unspecified style". You use them to group elements into groups, or has hooks for presentation without saying what that presentation is.

    Which is why as a rule of thumb you shouldn't be adding DIV or SPAN until AFTER you've written your base semantic markup and have started applying your CSS to it -- remember, PROPERLY written HTML shouldn't be saying ANYWHERE inside it what things look like, it should say what things ARE, which is why getting all your headings, paragraphs, and lists in place BEFORE you start screwing around with making a layout is important.

    Assuming you're using semantic markup and separation of presentation from content; though honestly I'm tempted to STOP calling it that and call it what it REALLY is... USING HTML PROPERLY.

    Which the vast majority of people sleazing out websites don't do.
    Share on Google+

  5. #5
    Join Date
    May 2014
    Location
    India
    Posts
    23
    Is Div tag in HTML against W3C standards?
    Share on Google+

  6. #6
    Join Date
    Apr 2014
    Location
    Burnley uk
    Posts
    70
    No its not against the W3C standards
    Share on Google+

  7. #7
    Since it's in the specifications for HTML 4.01 STRICT, XHTML 1.0 STRICT and HTML 5? Why would it be non W3C?
    Share on Google+

  8. #8
    Join Date
    May 2014
    Location
    India
    Posts
    23
    Thanks for reply. I appreciate your answer.
    Share on Google+

  9. #9
    The div element is a block level element used for grouping HTML elements.
    Share on Google+

  10. #10
    Join Date
    Jun 2014
    Location
    San Antonio
    Posts
    5
    The div element is a block level element used for grouping HTML elements.


    *** Link Removed by Site Staff so it doesn't look like you are spamming us. ***
    Share on Google+

  11. #11
    Join Date
    May 2014
    Location
    bangalore
    Posts
    39
    DIV tag is worke with same as TABLE.
    Wherever you want use DIV tag.
    for Ex:
    1.container
    2.menu
    3.content area
    4.footer
    5.ect,.
    you can use No.of DIV tags in your site.
    Share on Google+

  12. #12
    Join Date
    Jul 2014
    Posts
    1
    CSS Division (div) is a container element and it is used to group related items together.
    More about...CSS Div

    Lynda

    Quote Originally Posted by Promatics View Post
    Is Div tag in HTML against W3C standards?
    Share on Google+

  13. #13
    Join Date
    Mar 2012
    Posts
    1,813
    This thread seems to have run its course. Thread closed.
    Share on Google+

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles