
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
How to define multiple style rules for a single element in CSS?
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.
- Related Articles
- How to use style attribute to define style rules?
- Style Rules in CSS
- Rules to override Style Sheet Rule in CSS
- How to use inline CSS style for an element in HTML?
- How to define multiple CSS attributes in jQuery?
- Set Media Queries for different CSS style rules for different size devices
- How to style an hr element with CSS?
- How to apply two CSS classes to a single element?
- Would you recommend to define multiple Python classes in a single file?
- How to check multiple columns for a single value in MySQL?
- Multiple COUNT() for multiple conditions in a single MySQL query?
- Set a CSS style for the element when the animation is not playing
- How to write a single MySQL query for displaying a value for multiple inputs?
- Set outline style as a solid single line with CSS
- Style every checked element with CSS

Advertisements