SitePoint Sponsor |
|
User Tag List
Results 1 to 4 of 4
Thread: <style>...</style> within <body>
-
Feb 15, 2008, 12:39 #1
- Join Date
- Apr 2003
- Location
- Lausanne
- Posts
- 115
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
<style>...</style> within <body>
In order to spice up the ads I'm publishing on this classified site, I inject my own CSS within <style>...</style> tags. To do so, I use the HTML tab provided on the Textarea of the form (like eBay). These tags are therefore within the BODY of the whole document (I obviously have no access to the <head> section of it).
It works fine but I'm wondering if forcing <style>...</style> in the BODY itself is Ok from a technical stand point. I'm worried about disrupting the good functionning of the site.
Thanks for any input or other ideas for doing the same thing, but please, don't suggest inline styling.
Dan
-
Feb 15, 2008, 12:47 #2
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
Since the standards say that those tags belong in the <head> it means that browsers are not required to support them in the <body>. That the current version of the major browsers do support them there does not mean that all browsers support them there or that future versions of browsers will support them. For the most part though the worst that is likely to happen is that the styles get ignored. I doubt that any browsers will just ignore the tags and display their content as text in the page.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Feb 15, 2008, 13:49 #3
- Join Date
- May 2006
- Location
- Aurora, Illinois
- Posts
- 15,476
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Not only that Stephen, but some mobile phones (mine especially) will just parse all styles in the BODY section, whether inlined or (incorrectly) embedded, as plain text. And I have to pay for that too! (Literally - as in money.)
Save the Internet - Use Opera | May my mother rest in peace: 1943-2009
Dan Schulz - Design Team Advisor | Follow me on Twitter
SitePoint References: HTML CSS JavaScript | Become A Guru
WordPress SEO Checklist | What WordPress Plugins Do You Use?
Web Standards Curriculum | Image Free Equal Height Columns
-
Feb 15, 2008, 13:52 #4
- Join Date
- Apr 2006
- Posts
- 249
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It's always possible that some of the styles you define in your style tags may conflict with styles for the over-all site - which may make your classified look bad, or make the site-owners unhappy....
Bookmarks