What is CSS?

Discussion in 'CSS' started by xmartel, Jul 11, 2008.

  1. #1
    I'm just really getting into designing websites, and so far the only language I know is basic HTML, and I've been thinking I should probably learn other languages if I want to build really nice sites.

    But I've been wondering, what exactly is CSS? I here about it a lot, but I realized I don't actually know what it is. How is it different than HTML? What is it used for? Does anyone have an example of what it looks like, Both the code and the finished product?

    Thanks for answering the noob questions.
     
    xmartel, Jul 11, 2008 IP
  2. wisdomtool

    wisdomtool Moderator Staff

    Messages:
    15,825
    Likes Received:
    1,367
    Best Answers:
    1
    Trophy Points:
    455
    #2
    Frankly and sorry to say that it is really a noob question, any search would have given you the answer, don't need a forum post for a definition. You can learn from good sites for eg

    http://www.w3schools.com/Css/default.asp
     
    wisdomtool, Jul 11, 2008 IP
  3. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #3
    In a nutshell, html is a structural markup language that uses tags to state what each part of a document is. CSS is a presentation language that defines how the html document parts are to be displayed.

    Let me give you a simplistic example. Say you want your main header on each page to be red. In html you would use the font tag, eg. <h1><font color=red>Blah!</font></h1>. There are two major issues with this. First, the font tag is no longer a part of html (since 1999), and browsers are not required to support it (though they do). Second, if you decide to change the color, you will have to find every instance of h1 and edit the font tag. Using css, the html would be <h1>Blah!</h1> and the css file would have h1 {color: red;}. To change the color of all h1s, you simply change the one entry in the style sheet.

    W3schools is good, if a bit dated in its approach. Follow the HTMLDog tutorials in the order presented for a better learning experience.

    wisdomtool is correct, good netiquette would suggest you stfw before posting to a forum.

    cheers,

    gary
     
    kk5st, Jul 11, 2008 IP
  4. Tudi

    Tudi Peon

    Messages:
    515
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I would strongly advise learning CSS in paralell to HTML. If you get used to HTML alone, you'll be having a harder time releasing those old HTML habits and replacing them with the new standards later on.
     
    Tudi, Jul 11, 2008 IP
  5. rowen77

    rowen77 Peon

    Messages:
    264
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #5
    CSS Allows you to Seperate Presentation From Structure

    It Allows you to control a million page styles from one document, which you save as a .css file

    You can like html, put the css in a notepad document, then link from the html document to the CSS document. You put the Link in the head of the document

    CSS allows you to significantly Reduce code, it makes it easier tremendously to organise what your doing

    Visually CSS can make beautiful webpages, very simply, have a Look at the webpage CSS Zen Garden

    The Simplicity of CSS allows easier Indexing in Search Engines

    I highly recommend the book "CSS The missing Manual"

    Good Luck
     
    rowen77, Jul 11, 2008 IP
  6. skenk

    skenk Banned

    Messages:
    180
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #6
    CSS = Counter Strike Source haha Only joking ;)
     
    skenk, Jul 12, 2008 IP
  7. faithnomoread

    faithnomoread Peon

    Messages:
    174
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    CSS makes coding for HTML more fun and easier. It save alot of time from having to write the same code over and over again.
     
    faithnomoread, Jul 13, 2008 IP
  8. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    HAHA SKENK

    an example of css would be this.

    
    <style>
    h1 {
    color:red;
    font-size:1.2em;
    }
    p.small {
    font-size:.8em;
    }
    </style>
    <h1>Header 1 test</h1>
    <p class="small">Small text test</p>
    
    Code (markup):
    output:

    Header 1 test
    Small text test
     
    X.Homer.X, Jul 13, 2008 IP