Computer Hope
Internet & Networking => Web design => Topic started by: shouvik on December 30, 2008, 09:06:58 PM
-
My html document on the page is:-
<HTML>
<HEAD>
<TITLE>HOW DO YOU DO THAT</TITLE>
<link href="creating.css" rel="stylesheet" type="text/css">
<body>
<span class="headlines">Welcome</span>
<div class="sublines">
This is the paragraph
</div>
<table border="2"><tr><td class="sublines">
This is the second paragraph
</td></tr></table>
<div class="infotext">
This is the footer
</div>
</body>
</html>[/color]
The external css file (creating.css) is:-
body {
.headlines, .sublines, infotext {font-face:arial; font-weight:bold;}
.headlines {font-size:14pt; COLOR:RED; background:yellow;}
.sublines {font-size:12pt; COLOR:GREEN; background:red;}
.infotext {font-size: 10pt; COLOR:BLUE; background:yellow;}
}
The page is showing properly in internet explorer,
but not in firefox or opera.
i.e. in these two browsers i am not getting any color
or font size that i have mentioned in the CSS file.
What have I done wrong?
-
Some codes always does not do same thing different browser. it would be better to visit the url of w3c. Hope it make u transparent.
copy this URL: http://w3c.org
-
You have the CSS file formatted wrong. You cannot place element classes inside the body class.
Try this:
.headlines, .sublines, .infotext
{
font-face:arial;
font-weight:bold;
}
.headlines
{
font-size:14pt;
COLOR:RED;
background:yellow;
}
.sublines
{
font-size:12pt;
COLOR:GREEN;
background:red;
}
.infotext
{
font-size: 10pt;
COLOR:BLUE;
background:yellow;
}
-
You have the CSS file formatted wrong. You cannot place element classes inside the body class.
Try this:
.headlines, .sublines, .infotext
{
font-face:arial;
font-weight:bold;
}
.headlines
{
font-size:14pt;
COLOR:RED;
background:yellow;
}
.sublines
{
font-size:12pt;
COLOR:GREEN;
background:red;
}
.infotext
{
font-size: 10pt;
COLOR:BLUE;
background:yellow;
}
It worked. ;)
-
Good. :)