English

How do you define a CSS style rule?

Advertisements
Advertisements

Question

How do you define a CSS style rule?

Code Writing
Definition
Advertisements

Solution

By writing the selector tag without angle brackets, we define a rule. The following syntax is used to write the properties and their values:

selector { propertyname : value ; propertyname : value ; ...}

For example, we define the style rule as follows if we want the <H3 tag to have the font face Arial and color red:

h3 { font.family : Arial ; color : red ; }
shaalaa.com
  Is there an error in this question or solution?
Chapter 6: Cascading Style Sheets (CSS) - Assignment [Page 275]

APPEARS IN

Sumita Arora Computer Applications [English] Class 10
Chapter 6 Cascading Style Sheets (CSS)
Assignment | Q 14. (ii) | Page 275
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×