www.webdeveloper.com
Results 1 to 13 of 13

Thread: Too many divs??

  1. #1
    Join Date
    Oct 2012
    Posts
    55

    Too many divs??

    When making a page I always end up making a lot of divs, seems neat to hold a box of text.

    Would it be unreasonable to have a banner holder div with two divs inside it?

    Also when formatting does a <P> take css just like a div?

    Why I am scared to trust in css with out divs?

    Is it because IE has made me think everything will fall apart and end up on top of each other if not neatly confined in a div?

    Hi BTW Im making a web page in XHTML 1.0 strict with css 2 and a little of 3.

    Dan

  2. #2
    Join Date
    Aug 2006
    Posts
    1,904
    Set yourself free, man. CSS applies to every tag, not just the div tag. You've got what's commonly called "divitis"

    Dave

  3. #3
    Join Date
    Sep 2008
    Location
    Dallas
    Posts
    154
    Use what's appropriate. It's it's a bunch of text content, use <p>. If it's the beginning of sections, use <h1>, <h2>, etc. If it's a list, use <ul>. Keep in mind, for SEO purposes, you only use one <h1> per page. You can use as many divs as you need, nested however you need. Also, keep in mind, don't have block level elements inside of inline elements. It's not semantically correct. For example, don't do <li><div>stuff</div></li>. If you need a block level element within an inline element, use a <span> and display:block in the CSS.

  4. #4
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,119
    Quote Originally Posted by Javaboey View Post
    Also, keep in mind, don't have block level elements inside of inline elements. It's not semantically correct. For example, don't do <li><div>stuff</div></li>.
    LI's are not inline elements. There are cases when DIV's inside LI's make total sense. For example:
    http://jsfiddle.net/d8Txw/17/
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  5. #5
    Join Date
    Sep 2008
    Location
    Dallas
    Posts
    154
    My bad. So replace <li> with an inline tag. My point still stands. Don't use block elements inside inline elements.

  6. #6
    Join Date
    Oct 2012
    Posts
    55
    Quote Originally Posted by Javaboey View Post
    Use what's appropriate. It's it's a bunch of text content, use <p>. If it's the beginning of sections, use <h1>, <h2>, etc. If it's a list, use <ul>. Keep in mind, for SEO purposes, you only use one <h1> per page. You can use as many divs as you need, nested however you need. Also, keep in mind, don't have block level elements inside of inline elements. It's not semantically correct. For example, don't do <li><div>stuff</div></li>. If you need a block level element within an inline element, use a <span> and display:block in the CSS.
    I use XHTML STRICT, its easy until you want to add videos.

    I doubt the use of <H1> will make your site any better for SEO, It should really be outdated like the "FONT" tag.

    Dan

  7. #7
    Join Date
    Oct 2012
    Posts
    55
    Quote Originally Posted by cbVision View Post
    LI's are not inline elements. There are cases when DIV's inside LI's make total sense. For example:
    http://jsfiddle.net/d8Txw/17/
    The XHTML 1.0 Strict Validator sorts this out for me.

    You can have a <ul> <li> inside a <table> and a <div> and a <P> and you can access them with css.

    I have just realized ho difficult it is to add video compatible to popular browsers and formats.

    I am using HTML 5 <video> Tag, I have to say they are on the right track with this one.

    For all I have seen of embed and object and all the nasty writing you have to do, I am much happier just making a few extra copies with my converter and using <video> tag.

    Thanks HTML 5, you may have saved the web jostling corporates, my faith is resumed.

    Dan

  8. #8
    Join Date
    Oct 2012
    Posts
    55
    Quote Originally Posted by tracknut View Post
    Set yourself free, man. CSS applies to every tag, not just the div tag. You've got what's commonly called "divitis"

    Dave
    Yes but CSS3 is so well accepted these days, content is content, format is format.

    Dan

  9. #9
    Join Date
    Oct 2012
    Posts
    55
    Also I just have to say what is the use of the <object> CLISD tag?

    Must people write for the windows registry now just to post a video everyone can see?

    I still don't know what it is and hopefully I never will.

    Dan

  10. #10
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,119
    Quote Originally Posted by drunken_dev View Post
    I doubt the use of <H1> will make your site any better for SEO, It should really be outdated like the "FONT" tag.
    What's your source for this information? Sounds like malarkey.
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  11. #11
    Join Date
    Oct 2012
    Posts
    55
    No source, I was just saying.

    It is a bastardisation of old HTML, turning format into content, it should have been ditched years ago.

    Dan

  12. #12
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,119
    h1, h2, h3 tags have nothing to do with formatting content. It has everything to do with semantics. H is for heading ... would you suggest putting headings in paragraph tags? Or div tags?
    I'm always up for networking with fellow web professionals. Connect with me on LinkedIn if you like!

  13. #13
    Join Date
    Oct 2012
    Posts
    55
    Quote Originally Posted by cbVision View Post
    h1, h2, h3 tags have nothing to do with formatting content. It has everything to do with semantics. H is for heading ... would you suggest putting headings in paragraph tags? Or div tags?
    Ok I can see the point.
    But for what purpose? Does SEO really read so much of a page that it needs to digest your site as if reading a book?


    Cheers

Thread Information

Users Browsing this Thread

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

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