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!

CSS class defs in body somehow? 1

Status
Not open for further replies.

OsakaWebbie

Programmer
Feb 11, 2003
628
JP
I normally get to code my own stuff from top to bottom, but right now I'm working within a framework I can't control, and can only access a portion of the body of each page (and even that gets massaged later by forces beyond me!). The programming of the "framework" is still ongoing, so I have requested a means of having my own CSS file linked and being able to define classes and use them, and the programmer has agreed to implement it at some point. But meanwhile I still have to design my pages, and I want to minimize the amount of code I'll have to change later. So rather than use inline styles and have to change to classes later, I'd like to put the future class definitions somewhere where it will work, at least in the most commonly used versions of IE and/or Firefox. It doesn't have to validate (in fact, there is no way these pages will ever validate - the parts I can't control are horrible), just work. Any ideas on how to do that? I know the <style> tag and links to external stylesheets are only supposed to be in the header, but maybe there's a secret I don't know, or a way to use Javascript to sneak the defs into the header (if the massaging will leave my JS alone - I haven't tried it yet)... Thoughts?
 
You can place those style blocks into the body of the page (not standards compliant... but it'll let you get to where you want right now).
Code:
<body>
...
<style type="text/css">
...
</style>
...
</body>

Cheers,
Jeff

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

What is Javascript? FAQ216-6094
 
Yes, that seems to work, at least in the two browsers on my machine. Thanks, and I hope that your honest answer doesn't get you in trouble with the standards-compliance police... ;-)
 
Hey, when I write beautiful standards-compliant code (especially if CSS is involved), it usually still messes up in at least one browser anyway (we won't name names)...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top