SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Different between #page, #body and #content

    Hi

    I am writting a little bit on CSS and as I was doing this it occured to me that I do not the differences between #page, #body and content when it concerns CSS.

    When should I use what and is there an order here a Cascade?

    Any advice would be great

    Cheers

  2. #2
    Follow Me On Twitter: @djg gold trophysilver trophybronze trophy Dan Grossman's Avatar
    Join Date
    Aug 2000
    Location
    Philadephia, PA
    Posts
    20,580
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    The pound symbol (#) followed by some word is how you apply styles to a document element having the same ID.

    Example:
    HTML Code:
    <html>
    <head>
    <style type="text/css">
      #myparagraph {
        font-weight: bold;
      }
    </style>
    </head>
    <body>
      <p id="myparagraph">This is a paragraph I want to make bold</p>
    </body>
    </html>
    The words "page", "body" and "content" do not have any special meaning. They are just referring to something (which could be anything) you have identified by those words in your HTML.

    So you need to look at your own HTML document to figure out what those selectors are referring to.

  3. #3
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dan Grossman View Post
    The pound symbol (#) followed by some word is how you apply styles to a document element having the same ID.

    Example:
    HTML Code:
    <html>
    <head>
    <style type="text/css">
      #myparagraph {
        font-weight: bold;
      }
    </style>
    </head>
    <body>
      <p id="myparagraph">This is a paragraph I want to make bold</p>
    </body>
    </html>
    The words "page", "body" and "content" do not have any special meaning. They are just referring to something (which could be anything) you have identified by those words in your HTML.

    So you need to look at your own HTML document to figure out what those selectors are referring to.
    Yes of course it it

    Thanks for your help


Bookmarks

Posting Permissions

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