Cascading Style Sheets (CSS) — Question 10
Back to all questionsQuestion 10
Identify the errors in the codes below and write the correct code:
import url (style_imp.css)
<STYLE> p{color:808080} </STYLE>
<p style= "text:align: justify">
P {font: arial 15px sans-serif;}
{p-color:red;}
import url (style_imp.css)
The syntax of import statement is incorrect. It must be preceded by an '@' symbol and the terminator symbol ';' is also missing at the end. Thus the correct code is as follows:
@import url(style_imp.css);<STYLE> p{color:808080} </STYLE>
If the value of Color property is given as a Hexadecimal value, it must begin with a '#' symbol. The ' ; ' must be placed at the end of the value. Thus, the correct code is as follows:
<STYLE> p{color:#808080;} </STYLE><p style= "text:align: justify">
The name of the property is "text-align" and not "text:align". The correct code is as follows:
<p style= "text-align: justify;">P {font: arial 15px sans-serif;}
The order of values for font property should be in the following manner:
Syntax : Font:Font-style Font-variant Font-weight Font-size Font-family;
Thus, the correct code is as follows:
P {font: 15px arial sans-serif;}{p-color:red;}
The selector should be placed outside the parentheses. The correct code is as follows:
P {color:red;}