SitePoint Sponsor

User Tag List

Results 1 to 14 of 14

Thread: what is "#"

  1. #1
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    what is "#"

    I cant find a reference on what "#" is in css.
    Free Science Homework Help
    http://www.physicsforums.com

  2. #2
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Where did you see it?

    Where did you look for a reference?
    Mike
    It's not who I am underneath, but what I do that defines me.

  3. #3
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ignore me (read below)...
    Last edited by platinum; May 13, 2003 at 00:31.

  4. #4
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Comment? Eh?

    It's the notation marker for hexdec colours and ids (IDs).
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  5. #5
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Whoops, I am stupid, not sure what I was thinking there

    Bill is right, and it's also used in defining a layer (is that the right term?) like #leftmenu

  6. #6
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by platinum
    Whoops, I am stupid, not sure what I was thinking there

    Bill is right, and it's also used in defining a layer (is that the right term?) like #leftmenu
    In practice you are correct, though it's actually the div's id that the # (hash) is pointing to.
    It's just the fact that divs are the most commonly ided elements that leads to the idea that it is the div itself that the hash is pointing to.

    Any element with an id can be referenced in the css using the hash notation.

    E.g.
    Code:
    css:
    
    #leftmenu {
    height: 100px;
    width: 40px;
    }
    
    
    
    x/html:
    
    <table id="leftmenu">
      <tr>
        <td>...
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  7. #7
    Ceci n'est pas Zoef Zoef's Avatar
    Join Date
    Nov 2002
    Location
    Malta
    Posts
    1,111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    '#' does not refer to a comment, the only way to put a comment in CSS is like this: /* This is a comment */

    "#3366cc" is a colorcode, The '#' indicate that it's a hexadecimal value.

    #navigation { /*rules here */}
    Here '#' is used as an ID selector. It means, aply these rules to the element with id="navigation". This rule can only be aplied once. There should only be one element with this ID on a page.

    Please note that I'm talking about elements, not layers. It's never been clear to me what these layers are excactly. All the CSS articles/books I've read talk about elements.

    Rik
    English tea - Italian coffee - Maltese wine - Belgian beer - French Cognac

  8. #8
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there an echo in here?
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  9. #9
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think there is

  10. #10
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmmm whats the difference between using "." or "#" then?

    .test and #test are the same thing?
    Free Science Homework Help
    http://www.physicsforums.com

  11. #11
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    . denotes a class. You can reuse classes multiple times on a single page.

    For example:
    .l { text-align:left; }
    .r { text-align:right;}

    Then you can reuse those throughout your page.

    # is an id as specified before and should only be assigned to one element on your page.
    Wayne Luke
    ------------


  12. #12
    Ceci n'est pas Zoef Zoef's Avatar
    Join Date
    Nov 2002
    Location
    Malta
    Posts
    1,111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bill Posters
    Is there an echo in here?

    You're just to fast for me Bill!

    Rik
    English tea - Italian coffee - Maltese wine - Belgian beer - French Cognac

  13. #13
    gingham dress, army boots... silver trophy redux's Avatar
    Join Date
    Apr 2002
    Location
    Salford / Manchester / UK
    Posts
    4,838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dethfire, have a quick read through http://www.sitepoint.com/article/309/4 (and well, the whole article is actually quite a nice, soft introduction to most of CSS' core aspects)
    re·dux (adj.): brought back; returned. used postpositively
    [latin : re-, re- + dux, leader; see duke.]
    WaSP Accessibility Task Force Member
    splintered.co.uk | photographia.co.uk | redux.deviantart.com

  14. #14
    Robert Wellock silver trophybronze trophy xhtmlcoder's Avatar
    Join Date
    Apr 2002
    Location
    A Maze of Twisty Little Passages
    Posts
    6,316
    Mentioned
    60 Post(s)
    Tagged
    0 Thread(s)
    The hash # is basically a 'fragment identifier' and when referenced within CSS it is typically married with a 'CSS ID selector'.


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
  •