HighDots Forums  

embedding css in the <body> of a document

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss embedding css in the <body> of a document in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Biguana
 
Posts: n/a

Default embedding css in the <body> of a document - 01-13-2006 , 11:32 AM






OK, generally I wouldn't even try this, although it does work, but
imagine, if you will, the following circumstances.

I am posting content on the web, but rather than having complete
control over the website, I am using a web tool that allows me to
control the main "content" (div) section of a page while the tool lays
out the menu bars etc automatically. The page the "content" is
inserted into already has linked style sheets - indeed they control the
layout of the content and menubar, but I have no access to or control
over that linking (ie the head of the document) or the main stylesheet
itself.

I can use a web based WYSIWYG editor or insert html directly into my
"content" area (no parsing or tidying is done on it).

So, am I OK to put extra <style type="text/css"> </style> tags in the
body? It seems to work in IE and Firefox (the only browsers I've
tested) or is that a no no for some reason?

Speak now or forever hold your peas.

Any advice appreciated.

Tim


Reply With Quote
  #2  
Old   
David Dorward
 
Posts: n/a

Default Re: embedding css in the <body> of a document - 01-13-2006 , 12:38 PM






Biguana wrote:

Quote:
So, am I OK to put extra <style type="text/css"> </style> tags in the
body?
It is forbidden by every ISO and W3C HTML specification.

Quote:
I am posting content on the web, but rather than having complete
control over the website, I am using a web tool that allows me to
control the main "content" (div) section of a page
I suggest you fix the tool

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #3  
Old   
Biguana
 
Posts: n/a

Default Re: embedding css in the <body> of a document - 01-14-2006 , 01:07 PM



Pants. It does work though? Added to which it's not my tool to fix.
I am a user. Which was rather my point. And the tool provider could
just argue that css use isn't supported.

Thank you for your answer anyway.


David Dorward wrote:
Quote:
Biguana wrote:

So, am I OK to put extra <style type="text/css"> </style> tags in the
body?

It is forbidden by every ISO and W3C HTML specification.

I am posting content on the web, but rather than having complete
control over the website, I am using a web tool that allows me to
control the main "content" (div) section of a page

I suggest you fix the tool

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/
Home is where the ~/.bashrc is


Reply With Quote
  #4  
Old   
Jim Moe
 
Posts: n/a

Default Re: embedding css in the <body> of a document - 01-14-2006 , 02:52 PM



Biguana wrote:
Quote:
Pants. It does work though? Added to which it's not my tool to fix.
I am a user. Which was rather my point. And the tool provider could
just argue that css use isn't supported.

It may work. Because it is non-conformant, it is up to the browser's
fertile imagination to decide what to do with the invalid chunk of code.
It would be more useful if the tool allowed some way to add CSS to the
local page.
Quote:
So, am I OK to put extra <style type="text/css"> </style> tags in the
body?

It is forbidden by every ISO and W3C HTML specification.


--
jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)


Reply With Quote
  #5  
Old   
David Dorward
 
Posts: n/a

Default Re: embedding css in the <body> of a document - 01-14-2006 , 03:09 PM



Biguana wrote:

Please don't top post.
http://allmyfaqs.net/faq.pl?How_to_post

Quote:
Pants. It does work though?
Maybe. Maybe not. It depends on the error recovery routines and/or bugs in
the browser.

Quote:
Added to which it's not my tool to fix.
I am a user.
So replace the tool.

Quote:
And the tool provider could just argue that css use isn't supported.
Then really change the tool. This is 2006! Not 1996!

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is


Reply With Quote
  #6  
Old   
Chris Morris
 
Posts: n/a

Default Re: embedding css in the <body> of a document - 01-14-2006 , 03:33 PM



Jim Moe <jmm-list.AXSPAMGN (AT) sohnen-moe (DOT) com> writes:
Quote:
Biguana wrote:
Pants. It does work though? Added to which it's not my tool to fix.
I am a user. Which was rather my point. And the tool provider could
just argue that css use isn't supported.

It may work. Because it is non-conformant, it is up to the browser's
fertile imagination to decide what to do with the invalid chunk of code.
It works surprisingly often to add <style> blocks outside <head>,
though a well-written tool should obviously disallow it (along with
the valid <script>, and a few others) because of the potential to
seriously mess up the page (though it doesn't have *quite* the same
level of security implications as allowing <script>)

Quote:
It would be more useful if the tool allowed some way to add CSS to the
local page.
If it's letting you try adding <style> to something it *knows* is
going to be in <body> context I can hardly imagine it complaining at
<p style='font-size: 120%'>...</p>

--
Chris


Reply With Quote
  #7  
Old   
Biguana
 
Posts: n/a

Default Re: embedding css in the <body> of a document - 01-14-2006 , 04:07 PM



Hello,

Quote:
Please don't top post.
Apologies, just being lazy.

Quote:
Then really change the tool. This is 2006! Not 1996!
Indeed. In fairness, I do need to find out if there's a facility for
CSS. Changing the tool is not an option as it is part of a service
offered by the organisation I work for, to allow (relatively)
non-technical staff to set-up web-pages, that still have the
organisational branding (and menu bars etc). Thus changing the tool
would require changing my job!

Quote:
a well-written tool should obviously disallow it
Again it's not really the fault of the tool - as "malicious" (or inept)
use of the tool isn't expected from staff, thus quite a lot of freedom
is given.

Thanks again for all the feedback.

Tim



Reply With Quote
  #8  
Old   
Matt Silberstein
 
Posts: n/a

Default Re: embedding css in the <body> of a document - 01-14-2006 , 11:15 PM



On Sat, 14 Jan 2006 21:09:23 +0000, in
comp.infosystems.www.authoring.stylesheets , David Dorward
<dorward (AT) yahoo (DOT) com> in <dqbpd4$jp5$1$8302bc10 (AT) news (DOT) demon.co.uk> wrote:

Quote:
Biguana wrote:

Please don't top post.
http://allmyfaqs.net/faq.pl?How_to_post

Pants. It does work though?

Maybe. Maybe not. It depends on the error recovery routines and/or bugs in
the browser.

Added to which it's not my tool to fix.
I am a user.

So replace the tool.

And the tool provider could just argue that css use isn't supported.

Then really change the tool. This is 2006! Not 1996!
Suppose, for example, the "tool" is an ebay ad? You can't change that,
but having styles in your ads can help. I use stuff for each element,
but having an attached sheet would be nice. Oh well. It would probably
mess up other things after the ad.

--
Matt Silberstein

Do something today about the Darfur Genocide

http://www.beawitness.org
http://www.darfurgenocide.org
http://www.savedarfur.org

"Darfur: A Genocide We can Stop"


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.