In: Computer Science
Write a rule for an id selector named subheading. Set the border-bottom property to solid 1 px and the font-family property to arial. Apply the heading class to the
element in the document.
/* style rule for id=subheading */
#subheading{
border-bottom: solid 1px;
font-family: Arial, Helvetica, sans-serif;
}
Heading class can be applied to h2 like
Demonstration :
Here a new web page with name "2.html" is created, which contains following code.
2.html :
/* style rule for id=subheading */
#subheading{
border-bottom: solid 1px;
font-family: Arial, Helvetica, sans-serif;
}
/* style rule for class heading */
.heading{
color: gray;
}
This is subheading
======================================================
Output : Open web page 2.html in the browser and will get the screen as shown below
Screen 1 :2.html