www.webdeveloper.com
Results 1 to 7 of 7

Thread: [RESOLVED] Difference between regular stylesheet and Global CSS...

  1. #1
    Join Date
    Dec 2012
    Posts
    81

    resolved [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?

  2. #2
    Join Date
    Mar 2011
    Posts
    1,133
    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.
    Rick Trethewey
    Rainbo Design

  3. #3
    Join Date
    Dec 2012
    Posts
    81
    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...

    Code:
    <link href="css/reset.min.css" rel="stylesheet"/>
    <link href="css/global.css" rel="stylesheet" />
    <link href="css/style.css" rel="stylesheet" />
    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.

    If they're cascading, each succeeding stylesheet overrides the previous one.

    What is the point of the reset.min.css sheet?

  4. #4
    Join Date
    Mar 2011
    Posts
    1,133
    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.
    Rick Trethewey
    Rainbo Design

  5. #5
    Join Date
    Dec 2012
    Posts
    81
    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?

  6. #6
    Join Date
    Mar 2011
    Posts
    1,133
    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.
    Rick Trethewey
    Rainbo Design

  7. #7
    Join Date
    Dec 2012
    Posts
    81
    Great! Thanks Rick. I'll play around with the concept.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles