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

Styles tag ...

Status
Not open for further replies.

dbeezzz

Technical User
Nov 30, 2005
54
0
0
KR
Can I put a styles tag outside of the head part of the document ?
Code:
<html>
<head>
<style1></style>
</head>
<body>
<style2></style>
</body>
</html>
... is this illegal ? will it validate ?
 
Hi

Is not valid. I usually put [tt]style[/tt]s in the body part only temporarily, while editing/testing. Until now, no browser seems to care about its placement. ( Of course, I put it always above the referenced HTML code. ) But is ugly and invalid.

Feherke.
 
Well at the moment I'm using a templating system with multiple style sheets and multiple pages. So it would just be handier to stick the css in with the code. It's not the end of the world though I guess.
 
Use inline styles then
Don't use inline styles. Seperate those layers!

Do exactly what you propose (whilst in development)... put the style block in the include file itself (like you might a script block). Then, when the site is done... collect all the style blocks and wrap them into one big css file and link to it using the main template page.

Using inline styles is sloppy - and especially not necessary if you are building a site from scratch.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top