SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: CSS 3 Questions

  1. #1
    SitePoint Enthusiast ParfaitMacaron's Avatar
    Join Date
    Mar 2013
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS 3 Questions

    1. Is there a default template for CSS 3 stylesheets? If so, where can I find this?

    2. In CSS 3, does ordering of code matter? For example, putting

    Code:
    padding: 0;
    margin: 0;
    instead of

    Code:
    margin: 0;
    padding: 0;
    3. Is CSS 3 compatible with most standard browsers?

    4. In CSS coding, are header and footer default names?

    Thank you!

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    CSS3 is really just CSS with some extra options. A template for a CSS3 stylesheet doesn't make much sense to me. A stylesheet is really just a list of styles for a particular site. Until you know what the site needs to look like, you don't know what needs to be in the style sheet.

    CSS3 rules follow the same rules for ordering. The order doesn't matter, unless there are two rules for the same thing, in which case the second one will win—as long as they both have the same weight/specificity.

    CSS3 is still in production, in a series of modules. None of them are afficially ready yet, though some have reached their final form, it would seem, and modern browsers have started to support them. But a lot of CSS3 doesn't wok in any browser yet. You have to check what parts are supported and use them wisely. Older browsers like IE8 and under have no idea.

    CSS will style whatever elements you target, so you can target <header> and <footer> just fine. You can style XML with CSS.

  3. #3
    SitePoint Enthusiast ParfaitMacaron's Avatar
    Join Date
    Mar 2013
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    CSS3 is really just CSS with some extra options. A template for a CSS3 stylesheet doesn't make much sense to me. A stylesheet is really just a list of styles for a particular site. Until you know what the site needs to look like, you don't know what needs to be in the style sheet.

    CSS3 rules follow the same rules for ordering. The order doesn't matter, unless there are two rules for the same thing, in which case the second one will win—as long as they both have the same weight/specificity.

    CSS3 is still in production, in a series of modules. None of them are afficially ready yet, though some have reached their final form, it would seem, and modern browsers have started to support them. But a lot of CSS3 doesn't wok in any browser yet. You have to check what parts are supported and use them wisely. Older browsers like IE8 and under have no idea.

    CSS will style whatever elements you target, so you can target <header> and <footer> just fine. You can style XML with CSS.
    Thank you for your quick reply! Is there a particular term for the second one? Is it called overriding?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,214
    Mentioned
    457 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by ParfaitMacaron View Post
    Thank you for your quick reply! Is there a particular term for the second one? Is it called overriding?
    In the case of the example you gave, they are two different rules, relating to different things, so there's no issue of overriding there. The full name for CSS includes the word 'cascading', which is one way of looking at this question. Multiple styling rules that apply to a particular element cascade over the top of each other according to various rules. The general term for those rules is 'specificity'.


Bookmarks

Posting Permissions

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