How to define multiple style rules for a single element in CSS?

JavascriptWeb DevelopmentFront End Scripts

You may need to define multiple style rules for a single element. You can define these rules to combine multiple properties and corresponding values into a single block as defined in the following example: 

h1 {
   color: #36C; font-weight: normal;
   letter-spacing: .4em;
   margin-bottom: 1em;
   text-transform: lowercase;
}

Here all the property and value pairs are separated by a semicolon (;). You can keep them in a single line or multiple lines. For better readability, we keep them on separate lines.

raja
Published on 13-Apr-2018 07:24:26
Advertisements