August 24th, 2012, 02:59 PM
Linking style sheets - formatting question
Lets say I have sheets 1, 2 and 3 linked to main.css.
Should I declare #container in sheet1.css, main.css or each css doc?
August 24th, 2012, 03:19 PM
That depends on why you have three sheets linked to main.css.
For example, if one of the sheets is called container.css and contains stylesheet rules for containers, then it makes sense to define it there. If one of the sheets is called colors.css and another is called borders.css, and #container has both a color and a border, then it makes sense to declare it in both.
August 24th, 2012, 03:42 PM
Thanks for the quick response E-Oreo. From what you say, I think I might not understand the concept of container correctly. Could you please define #container for me? And is #container and #wrapper the same thing?
August 24th, 2012, 06:55 PM
There is really no concept behind a container. #container is just an identifier. I could name it #a83482849 and it would function exactly the same. You name your identifiers whatever is logical for your markup, all identifiers are equal and the same.
By definition a container is something that is capable of holding something else, so most HTML tags fit that definition pretty well. A wrapper has nearly the same definition. There is no convention or standard as to what identifier names you use, but the more descriptive the name is the better.
When I think of a container element I normally think of something that doesn't "know" what's going to be rendered inside of it. That may not make sense, but it doesn't really matter because it's just my personal preference and I make it up as I go.
August 25th, 2012, 12:19 PM
Thanks again. I was under the impression that it is madatory to have a first element called #container or #wrapper in the css code for all the website. A 'meta-div' that would contain all the other divs. After watching and reading a few more tutorials, Im begiining to understand that a #wrapper used as a 'meta-div' can help make the sections inside of it fit properly and look good on the website, but it's not required.
Lots to learn with css and sometimes it's hard to sort the wheat from the chaff (the good turorials from the bad)!!!!