Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with CSS 1

Status
Not open for further replies.

psandekian

Programmer
Oct 12, 2000
48
0
0
US
Hi. I'm having two problems with my CSS. Here's my CSS file:
Code:
<STYLE type=&quot;text/css&quot;>
<!-- 
H6 { }

H1
{
    font-weight: 500;
	 font-size: medium;
    TEXT-ALIGN: center;
}

body
{ background-image: url(&quot;Texture_lt_gray_004.jpg&quot;);
	 background-color: #E1E1E1;
	 font-family: Arial, Tahoma, Serif; 
	 font-size: medium; 
	 font-weight: 600; 
	 font-style: normal;
	 color: #00468C;
}

P
{
    FONT-SIZE: 12pt;
    TEXT-ALIGN: left;
	margin-left: 12%; 
	margin-right: 10%;
}

H2
{
    FONT-FAMILY: &quot;Stylus BT&quot;, Tahoma, Serif;
    font-weight: 900;
	 font-size: x-large;
    TEXT-ALIGN: center;
}

h3
{
	font-size: 15pt;
	font-weight: bold;
	font-style: italic;
	text-align: center;
}

h4
{
   font-family: &quot;Van Dijk&quot;, Tahoma, Serif; 
   font-size: medium; 
   font-weight: 700; 
   color: #930049;
   text-align: center;
}

TR
{
    FONT-SIZE: 12pt;
	text-align: center;
	font-weight: bold
}

ul
{
    FONT-SIZE: 12pt;
	margin-left: 12%; 
	list-style-position: inside;
}

ul.out
{
    FONT-SIZE: 12pt;
	margin-left: 15%; 
	list-style-position: outside;
}


 A.pj
{
    COLOR: #930049;
    background-color: #E1E1E1;
	background-image: url(&quot;Texture_lt_gray_004.jpg&quot;);
	font-family:NevisonCasD, Arial, Serif;
}

-->
</style>
Problem 1: I had to put the empty tag H6{} as my first tag because my first tag would not work. This took me a long time to figure out it was just the first tag not working. Does anyone have any ideas why? PS. It works fine off my hard drive but not off the host server.

Problem 2: I can't get it to pass the validation. I get the following errors:

Line: 1
Parse error - Unrecognized : <STYLE type=&quot;text/css&quot;><!-- H6 { }

Warnings
Line : 1 Level : 1 You have no background-color with your color : h4

On the first error, I don't understand it at all. Am I messing up the first statement of my CSS file? The second error, I change my text color. Do I need to restate the background color and image? If so, why when I want them to be the same as the rest of the body?

Thanks!
Patty
 
If this is a seperate css file you need to get rid of the <style> and </style> tags...

It will still pass the validation test with the background-color warning, but if you want to get rid of the warning just set the background-color for the h4 element to whatever you want it to be. Generally it's a good idea to specify a background-color when you specify a color, but it's not necessary.
 
Thanks! I removed the style tags and my empty h6 tag and it works. It also passed the validation without changing my h4 tag colors.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top