Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: Tags in CSS?

  1. #1
    New to the CF scene
    Join Date
    Oct 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Tags in CSS?

    Hey everyone

    Just joined the forum
    It's been a few years since I last did any programming in relation to HTML, CSS and JS. I've looked at a few templates to see how different developers plan and program their sites. My question is why in a CSS document would a developer place this:

    Code:
    "  article, aside, audio, canvas, command, datalist, details, embed, figcaption, figure, footer, header, hgroup, keygen, meter, nav, output, progress, section, source, video {
    	display:block
    }
    mark, rp, rt, ruby, summary, time {
    	display:inline
    }"
    I've heard that it's tags? But I don't understand it's purpose, sorry for the stupid question. Hope everyone's ok and thanks in advance!

  • #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,459
    Thanks
    0
    Thanked 632 Times in 622 Posts
    They are proposed HTML 5 tags that not all browsers currently understand. By including those definitions in the CSS it becomes possible to use those tags in the HTML without the page breaking in the browsers that don't understand them.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,474
    Thanks
    6
    Thanked 980 Times in 953 Posts
    CSS has no tags, it has selectors, properties, and values, grouped in rules:
    Code:
    /* this is a comment and the line below is a CSS rule */
    selector {property: value;}
    The simplest selectors are element selectors. The selector h1 applies to all <h1> elements in the HTML document:
    Code:
    h1 {color: red;}
    And if multiple element types should get a similar style, CSS selectors can be separated by commas: h1, p {color: red;} applies to all <h1> and <p> elements in the document.

    So, in conclusion, what you posted above are all element selectors that apply to their respective HTML counterparts (in this case it’s mostly the new HTML 5 elements), like <article>, <aside>, <audio>, etc.

    These quotes, however, are invalid and should not be there. But it might be that you’ve just put them there by accident.


  •  

    Tags for this Thread

    Posting Permissions

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