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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE body style in external CSS problem

Status
Not open for further replies.

jabhawk

Programmer
Apr 23, 2002
71
US
I have created a default CSS file to use as an extrnal base for all of the pages in an online brochure. The problem I am seeing is that the BODY definitions are not being applied on the page (IE 6).

The pages are basic and do not override the body options but the color settings just will not show. I want to set a basic bgcolor, font and font size for each page.

Any ideas.

default.css
body { background-color: #99CCFF; background-image: none}
...



Jonthan A Black
 
You seem to be implying that your other tag-styles in your external style sheet ARE working. Is that right?

Show the way you link the style sheet into the HTML. Your body tag style works for me in IE6.

--Dave
 
Here it is:
<link rel=stylesheet type="text/css" href="../default.css" title="default css">

I use the same for each page. To get arround this for now I created a DIV to surround the body of the page and added a CSS entry for the DIV id. Not the best way but it works so far.

Jonthan A Black
 
Ok, strange. I added a blank line before the body definition in the CSS and it works now?!?!?
--
<!-- Default CSS styles -->

body { font-family: Futura Bk BT;
color: #0000FF;
font-size: 11pt;
background-color:#99CCFF}
-- vs --
<!-- Default CSS styles -->
body { font-family: Futura Bk BT;
color: #0000FF;
font-size: 11pt;
background-color:#99CCFF}
--


Jonthan A Black
 
the problem is the comment line!

comments in external CSS files should be /* comment */ (pascal style)

not <!--comment--> HTML style

this would cause to the first definition to be ignored as a syntax error.



Chris.

Indifference will be the downfall of mankind, but who cares?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top