Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2003
    Location
    Australia
    Posts
    528
    Thanks
    8
    Thanked 8 Times in 8 Posts

    CSS Book - Little mention of DIV

    Howdy...

    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!

    Taylor.

  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Canada
    Posts
    253
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the DIV itself is a container (similar to a P tag).

    <div>
    text and stuff goes here.
    </div>

    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.
    </div>

    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
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,300
    Thanks
    28
    Thanked 275 Times in 269 Posts
    Quote 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.
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

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