Computer Applications
What would this CSS rule do ?
p { color:red;
}
- Make the background of all paragraphs red.
- Make the fonts of all paragraphs red.
- Make all text boxes red.
- Make the border of all paragraphs red.
Answer
Make the fonts of all paragraphs red.
Reason — The breakup of the rule is as follows:
pis a selector in CSS, which targets all<p>elements. In HTML,<p>elements represent paragraphs.{}encloses the declaration block, which contains one or more property-value pairs.color:red;is a property-value pair within the declaration block. Here, thecolorproperty is set tored, which means the text color of all<p>elements will be changed to red.
So, applying this CSS rule to an HTML page would result in all paragraphs being displayed with red text color.
Related Questions
Which property is used to change the background color ?
- background-color
- bgcolor
- bg-color
- color
Which property is used to increase and decrease the text size ?
- font-width
- font-size
- text-width
- text-size
What would this CSS rule do ?
h2 { font-size:2em; }- Make fonts in a specific h2 tag double in size.
- Make fonts in all h2 tags double in size.
- Make fonts in all h2 tags double in size and italic.
- Make all fonts that are size 2, empty.
How do you link an external stylesheet to a page.
<link href='somefile.css'><link rel='stylesheet' src='somefile.css'><script rel='stylesheet' href=' somefile.css'> </script><link rel='stylesheet' href='somefile.css'>