Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Mar 2009
    Posts
    7
    Member #
    18646
    I'm still trying to understand some of the ways to work with CSS. I've been looking at the style.css of some programmers who put themes out. One question, I noticed that sometimes they will prefix the name for the tag with a '#' and sometimes they don't. I've also seen '.' used. How do I know when you use those symbols? I think the '.' means it's a class, but I don't know what '#' means? Can anyone enlighten me?

    Thanks in advance

  2.  

  3. #2
    Senior Member filburt1's Avatar
    Join Date
    Jul 2002
    Location
    Maryland, US
    Posts
    11,774
    Member #
    3
    Liked
    21 times
    #: an ID. Can be used only once on a page.
    .: a class. Can be used any number of times on a page, and even more than once on a given element.
    filburt1, Web Design Forums.net founder
    Site of the Month contest: submit your site or vote for the winner!

  4. #3
    Junior Member brandontran's Avatar
    Join Date
    Jul 2009
    Location
    Asheville, NC
    Posts
    21
    Member #
    19539
    Quote Originally Posted by Guybrush
    I'm still trying to understand some of the ways to work with CSS. I've been looking at the style.css of some programmers who put themes out. One question, I noticed that sometimes they will prefix the name for the tag with a '#' and sometimes they don't. I've also seen '.' used. How do I know when you use those symbols? I think the '.' means it's a class, but I don't know what '#' means? Can anyone enlighten me?
    Thanks in advance
    #header or something like that can only be used once in valid code. You can use it more than once accidentally but it will effect your coding so if you do use # make sure you only use it once.

    Use the W3 validate to make sure your code is valid: http://validator.w3.org/
    Brandon Tran - Asheville Web Design

  5. #4
    Senior Member aeroweb99's Avatar
    Join Date
    Feb 2008
    Location
    Port Huron, Michigan
    Posts
    1,037
    Member #
    16468
    Liked
    1 times
    Don't get confused throwing the word "tag" around. Tags do not require a symbol in front such as "h2, p, ul," and so on. The correct term for an id (#) or class (.) in css is called a "selector", such as a #container (id), or .small_text (class).

    Use class selectors when you think you may use them more than once such as text sizing, or some kind of color or something. id's are used more for layout of your divs, so it usually seems anyway.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:15 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com