Hello and welcome to our community! Is this your first visit?
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
    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:

    "  article, aside, audio, canvas, command, datalist, details, embed, figcaption, figure, footer, header, hgroup, keygen, meter, nav, output, progress, section, source, video {
    mark, rp, rt, ruby, summary, time {
    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. #2
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    Thanked 932 Times in 919 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.
    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. #3
    Administrator VIPStephan's Avatar
    Join Date
    Jan 2006
    Halle (Saale), Germany
    Thanked 1,315 Times in 1,285 Posts
    CSS has no tags, it has selectors, properties, and values, grouped in rules:
    /* 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:
    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