U of S | DCS | Courses | CAI | CSS | Selector Grouping

[Back] [Contents] [Next]


Define Several Items at Once.


If you want several HTML tags to have the same style properties, you can group them together by listing the HTML tags separated by commas.

For example, to display all the headings from <h1> to <h4> in a sans-serif font you could enter four separate lines, or you could group them together on one line like this:

This:
h1 {font-family:sans-serif}
h2 {font-family:sans-serif}
h3 {font-family:sans-serif}
h4 {font-family:sans-serif}

is the same as this:
h1,h2,h3,h4 {font-family:sans-serif}


Please send comments about this course to Kevin.Lowey@Usask.CA