[RESOLVED] Difference between regular stylesheet and Global CSS...
If HTML pulls all the CSS from a stylesheet, what is the purpose of a Global stylesheet? And is it all that important?
I see plenty of reason for the stylesheet, but I'm looking at a site's stylesheet and their global stylesheet right now. They each have a lot of the same classes and id's.
Is the HTML pulling the two different classes/id's at the same time? How does that work?
Can someone clear this up for me?
This is where the 'cascading' part of Cascading Style Sheets comes into play. The term "global" stylesheet is purely a term of art, and has no technical definition even though it is a common practice - especially in popular blog, forum, and CMS packages that allow optional plug-ins or add-ons.
Generally, a "global" stylesheet is used to hold the rules that would be shared throughout a website - the overall look-and-feel CSS rules. Then, individual pages within the site may or may not include additional stylesheets that can add new rules and modify/override the rules from the "global" stylesheet as needed to suit that particular page.
Sounds very similar to a Master Page in a .net framework. Am I on the right track?
Okay... so, the project I'm working on has header like this...
Based on your feedback, this is the header from my latest project. If I understand you correctly, my reset CSS is the primary, then the global, then the page's stylesheet.
<link href="css/reset.min.css" rel="stylesheet"/>
<link href="css/global.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />
If they're cascading, each succeeding stylesheet overrides the previous one.
What is the point of the reset.min.css sheet?
You've got the idea. The reset stylesheet generally eliminates the differences in the default settings for elements - commonly the 'margin' and 'padding' settings to reduce cross-browser compatibility issues.
Another question about this... still a little confused.
What kind of IDs/Classes would I put into a global stylesheet that I wouldn't put into a regular stylesheet?
The "global" stylesheet generally holds the rules that control the general structure and common features of all of the pages for a website. Things like the layout and typography that will be used on every page would usually be controlled in the global stylesheet.
As I say, there's no strict definition to go by here. Most websites use a single common stylesheet that could be considered the "global" stylesheet. But many module-oriented packages like Wordpress or Joomla rely on multiple stylesheets to control different aspects of a site like the sidebars or individual sections. How you go about using this capability is pretty much up to you as the designer.
Great! Thanks Rick. I'll play around with the concept.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)