Computer Applications
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;}
Answer
import url (styleimp.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(styleimp.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;}
Related Questions
Explain the purpose of using the shorthand Margin property.
How will you add padding space to all the four sides of an element?
Harsh is working on a client's project which requires him to add a picture on the top left part of the web page. While adding the picture, Harsh realised that the picture is being repeated multiple times. Suggest the property and its value to Harsh that can be used to stop the image from getting repeated.
Ruby has written the following code to shift a background image to the bottom-right corner of the page. The code however is not giving the desired result. Help her in finding a solution to the problem.
<body style= "background-image: url (C:/Desktop/image-3.jpg); background-repeat: no-repeat; background-position: 45% 90%; background-color: #cccccc"; >