Computer Applications
Namrata has written some style rules using the embedded style sheet method, but the effects are not getting applied on the elements. Instead the rules are getting displayed as such on the screen. What can be the possible reason? Suggest her some solution for the same.
Answer
One of the possible reasons for such a problem can be browser compatibility. Namrata may be using an older browser which doesn't support CSS.
Two ways in which the problem can be fixed are as follows:
- Namrata can switch to a browser which supports CSS.
- She should wrap the style sheet code within HTML comments:
<HTML>
<HEAD>
<TITLE> Embedding Style Sheets</TITLE>
<STYLE Type = "text/css">
<!--
...
style rules
...
-->
</STYLE>
</HEAD>
</HTML>
Related Questions
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;}
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"; >Diya wants to display all the text on her web page in blue colour with font size 3. Suggest Diya, which selector she should use to achieve the same.