/    Sign up×
Community /Pin to ProfileBookmark

Can a list of styles be embedded in the BODY?

Can a list of styles :

[code]
<style type=”text/css”>
body {
margin: 20px;
background: #9A823A;
color: #4C401C;
text-align: center;
padding: 0;
}

#outer {
text-align:left;
border:1px solid #000000;
width:740px;
/* height:440px;
overflow:hidden; */
margin:auto;
}
</style>
[/code]

be embeded at the top of the body of a document?
of can styles only be in the HEAD?

John

to post a comment
CSS

11 Comments(s)

Copy linkTweet thisAlerts:
@VladdyMar 23.2004 — Why would you want to put them in the document body anyway, not that you can: http://www.w3.org/TR/html4/present/styles.html#h-14.2.3
Copy linkTweet thisAlerts:
@BigjohnauthorMar 23.2004 — [i]Originally posted by Vladdy [/i]

[B]Why would you want to put them in the document body anyway, not that you can: http://www.w3.org/TR/html4/present/styles.html#h-14.2.3 [/B][/QUOTE]


I want to embed a list of styles into the 'body' section of the HTML - to style an item listing on EBAY.

They control the HEAD of the document, so I have no way to put anything there.

John
Copy linkTweet thisAlerts:
@VladdyMar 23.2004 — hmm.... that is a good one [reason]

While it is not legal, it seems like both IE and Gecko recognize the style element found in the document body and apply declaration within it correctly. It also does not seem to matter where the style element is inserted within the body.

So, since the HTML blocks you are using on e-bay have a limited lifespan ? and you are not concerned about validation, I would go ahead and put style element wherever you please.

Thanks for helping in acquiring this piece of information ?
Copy linkTweet thisAlerts:
@BigjohnauthorMar 23.2004 — [i]Originally posted by Vladdy [/i]

[B]hmm.... that is a good one [reason]



While it is not legal, it seems like both IE and Gecko recognize the style element found in the document body and apply declaration within it correctly. It also does not seem to matter where the style element is inserted within the body.



So, since the HTML blocks you are using on e-bay have a limited lifespan ? and you are not concerned about validation, I would go ahead and put style element wherever you please.



Thanks for helping in acquiring this piece of information ? [/B]
[/QUOTE]


seems to work in Moz too.
Copy linkTweet thisAlerts:
@ray326Mar 24.2004 — Moz == Gecko
Copy linkTweet thisAlerts:
@BigjohnauthorMar 24.2004 — [i]Originally posted by ray326 [/i]

[B]Moz == Gecko [/B][/QUOTE]

really? on my desktop the icon says 'mozilla firefox'. Nothin about any lizards...
Copy linkTweet thisAlerts:
@toicontienMar 24.2004 — Mozilla, Firebird, Firefox, Netscape 6+ and Camino all use the Gecko Runtime Environment to render Web pages. That's why Moz == Gecko.
Copy linkTweet thisAlerts:
@starrwriterMar 29.2004 — [i]Originally posted by Vladdy [/i]

[B]hmm.... that is a good one [reason]



While it is not legal, it seems like both IE and Gecko recognize the style element found in the document body and apply declaration within it correctly.[/B]
[/QUOTE]


Not legal -- that kills me. It's appalling that the metaphor of criminality has come to be applied to the use of privately-owned property like a computer. Every time I see the "illegal operation" alert on my computer I feel like using a sledge hammer to make kitty litter out of it.
Copy linkTweet thisAlerts:
@BigjohnauthorMar 30.2004 — And it does not work at all in NETCRAP...at least not version 7

John
Copy linkTweet thisAlerts:
@toicontienMar 31.2004 — Can we see the code? The reason I'm skeptical about not getting it to work in NS7 is because NS 7 was based on the 1.0 version of the Gecko Runtime Environment. So, it should work in NS7 if it works in Mozilla... should ?
Copy linkTweet thisAlerts:
@BigjohnauthorMar 31.2004 — [i]Originally posted by toicontien [/i]

[B]Can we see the code? The reason I'm skeptical about not getting it to work in NS7 is because NS 7 was based on the 1.0 version of the Gecko Runtime Environment. So, it should work in NS7 if it works in Mozilla... should ? [/B][/QUOTE]


[URL=http://stegenga.net/ebay/beths-listing.html]Try HERE[/URL]

It works in Firefox and IE5/6.

It breaks in Netcrap. Netcrap seems to ADD a <head> statement infront of the STYLE block, at least when I look at the 'view source' option....

John
×

Success!

Help @Bigjohn spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...