Jump to content

Universal Selector


The Praetorian

Recommended Posts

Maybe you could add into the section that talks about id and class, that you can use *.class as a universal selector for all elements that have that class.

It is covered on this page: http://www.w3schools.com/css/css_syntax.asp
You can also omit the tag name in the selector to define a style that will be used by all HTML elements that have a certain class. In the example below, all HTML elements with class="center" will be center-aligned:.center {text-align: center} In the code below both the h1 element and the p element have class="center". This means that both elements will follow the rules in the ".center" selector:  <h1 class="center">This heading will be center-aligned</h1><p class="center">This paragraph will also be center-aligned.</p> 
It's ok to drop the * and just use .class :)
Link to comment
Share on other sites

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...