treehouse : what would you like to learn today?
Web Design Web Development iOS Development

css to change whole site

  • I am new to CSS so here goes with what I am sure is a stupid question. I really like the way css replaces tables as a layout mechanism. I also would like to have all or most of the pages on my site reference the same style sheet so that site wide changes would be easy. When I go through the steps of buiding each page though, it seems I need css to help align page specific images. Which means that each page will need its own unique css markup. I would then be back to changing every page when a menu item changes. Can somebody explain how to do this better. Thank you so much in advance.
  • NO such thing as a stupid question.....

    I assume that all your page layouts are similar..

    do you know how to link to a style sheet?

    if not the code for it is:

    <link href=\"LINK TO YOUR STYLESHEET GOES HERE\" rel=\"stylesheet\" type=\"text/css\" />

    this gets placed in the head section (before the <body> tag)

    Look at the videos that Chris has created, they will give you a lot of visual help. Also look at the W3schools site for help. Finally get a good book, or if you don't want to splash out the cash i would recommend http://reference.sitepoint.com/css
  • I am linking to an external style sheet. It has all the basic layout markup in it. But since it has to tell each individual page what to do I still have to have lots of style sheets. At least that is what I think I have to do. Obviously I am missing something.
  • There is no shame in separate stylesheets for separate pages, but you will want to have one "main" stylesheet for the 90% of stuff that doesn't change from page to page. I do this all the time, and I think it is actually encourageable as it keeps your main stylesheet smaller and not loaded with stuff that is applicable only to one page.