Web Analytics Made Easy -
StatCounter CSS Book - Little mention of DIV - CodingForum


No announcement yet.

CSS Book - Little mention of DIV

  • Filter
  • Time
  • Show
Clear All
new posts

  • CSS Book - Little mention of DIV


    CSS is not my forte but am doing my best to learn it. I see many times the mention of how you should not use tables for layout, but rather DIV assigned by CSS.

    So rather than just learn through some tutorials (that I've found not very useful) on the net, and from help on this forum, today I went and purchased a book called, "core CSS Cascading Style Sheets" by Keith Schengili-Roberts.

    This book was published in 2000. Yet, it has only TWO mentions of DIV and both times they are mentioned in one mere sentence.

    I feel that I've possibly just wasted money on this book.

    Can someone suggest a book to purchase that might help me along my path!!!

    Thanks in advance!


  • #2
    the DIV itself is a container (similar to a P tag).

    text and stuff goes here.

    not much to it in itself. css is then applied to it to make it conform to your needs. example...

    <div style="width:200px; height:300px; border:2px solid #ff000; position:absolute; left:100px; top:150px;">
    text and stuff goes here.

    sets the width and height.
    makes a border go around it.
    positions it 100x150 pixels from the left/top corner.

    learning all about css would be a definite benefit.


    • #3
      Elements and CSS

      The div element is not the replacement for layout table markup!

      A div is meant as a logical DIVision of a document; it is semantically neutral, which means that it doesn't add a whole lot of meaning to its contents compared to, say, paragraph or heading elements.

      In modern, semantically oriented markup, divs are mostly used to group sections of a page into logical chunks like header, menu, main content, footer, etc; exactly what they are meant for. Besides that, divs are also used to create further subdivisons that have little meaning to the contents, or as general containers mainly because they don't add meaning.

      Modern books about CSS tend to gravitate towards using the markup necessary to structure the page and it content as much as possible when styling needs to be added; although there's nothing wrong with using divs for the purposes described above, it's certainly discouraged to scatter them all over the place. Also, there simply is not much to say about them anyway.


      • #4
        Originally posted by Taylor_1978 View Post
        today I went and purchased a book called, "core CSS Cascading Style Sheets" by Keith Schengili-Roberts.
        I think you purchased the wrong type of book. div elements are of HTML, not CSS.