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

CSS problem for body control

Status
Not open for further replies.

NewBear

Programmer
Jul 30, 2003
6
HK
I created a stylesheet which control <body>, <table> etc. But it doesn't work for <body> control when I link the .css file into my html. Other tag seems ok.

If i put the <body> control style in the html, it's ok. What is the problem? I am new in web programming.
 
>> What is the problem?

Hard to say just by guessing... If you post the code that is giving you problems, you will have a better chance of an answer.
 
It would be helpful to see your style sheet. It might be that some styles defined in your stylesheet are over-riding your body style.

MrBelfry
 
Here is my css file -
<style type=&quot;text/css&quot;>

body {
background-color: Purple;
background-repeat : repeat-x;
}

</style>


and html file -
<html>
<head>
<LINK REL=&quot;stylesheet&quot; HREF=&quot;.\project_body.css&quot; style=&quot;text/css&quot;>
</head>
<body>
<table>
<tr><td>this is row</td></tr>
</table>
<input type=&quot;text&quot; value=&quot;hello&quot;></input>
</body>
</html>

Thanks,
New Bear.
 
You shouldn't have <style></style> tags in an external stylesheet.

Change your style sheet code to just:
[tt]
body {
background-color: Purple;
background-repeat : repeat-x;
}
[/tt]

And you should be fine
 
Thanks DT and all of u. It's OK now.

^_^ New Bear OOO
O
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top