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

style/link in body tag 1

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
I've hit a snag validating my code. ok I know it's my fault with the way my template/SSI design has been implemented, changing it will be a complete re-write.

the validator doesn't like the fact i have css styles linked into the page from the body tag, though it won't validate, the css is still linked in correctly and the page displays ok.

Is this such a biggie, ok not 100% symanticaly correct, i'm never gonna reach that because I'm not prepared to drop my tables for layout (At Present!).

So it's not symanticaly correct but , does linking in a css style in the body actually make the browser behave differently, it's not like missing an </>or /> end tag.

What i'm getting at is some rules can be bent, that's what css hacks are all about aren't they? , is placing a style in the body one of those rules that can be bent or do I honestly need to redesign my whole template system to truely validate.

If the only error in the code was having a <style> tag in the body, is that fair dinkum?



"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
It's one of the rules that can't be bent. Yes, at the moment every browser is still supporting style tags inside body tags, but in the future, you don't know what will happen. And having them where they shouldn't be opens you up for possible display errors. I really don't see what the big deal is. If you have style tags in the head or even better in a separate stylesheet, it shouldn't change your output in any way. Just more everything that has to do with the stylesheet into a separate css file. You can even create multiple css files and link all of them.
 
the 'big deal' is the way my site runs and the templates used, the 5 years of crap coding and the 'bolt ons' that have been added over the years, you see my menu requires the menu.css plus my site.css , I have them linked in on the menu template, and it is pulled in via my .shtml like so...
Code:
<html>
<head>
    <title>SSPL Company Information</title>
</head>

<body>

<!--#EXEC CGI="/cgi-bin/SSPL/menu.cgi?PG=About Us" -->

REST OF PAGE CODE
</body>
</html>

now either I have to change each page to inlcude the css files, or I remove the end </head> tag and include it in the menu code. either way it's a major change as I will have to re-visit every page and all PERL scripts to ensure I don't end up with 2 x </head> , ok my whole site needs validating anyway so I guess the change is immaterial, but I just wanted to get to the bottom of this menu problem in FF, not re-write my whole site.

I think i'll have to create a test environment, and do it a page at a time, I guess it just goes to show, if you do it right in the first place! , but hinde sight is no good to no-one!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top