Cascading CSS style sheet question

Log in to stop seeing adverts
This page may contain links to companies such as eBay and Amazon. As an affiliate of these sites I may earn commission if you click the link and make a purchase

Status
Not open for further replies.

spionfox

Well-Known Member
Is there a way to link to an external style sheet WITHOUT putting the link in the HEAD section? Or is there a way to have embedded styles on a page without putting this info in the HEAD section?

I'm doing a newsletter and can only customise the BODY section of the HTML - the HEAD section is out of bounds!

I know I could use in-line CSS but that needs loads more text which should be unnecessary when using CSS.

Thanks.
 
Re: CSS style sheet question

Is there a way to link to an external style sheet WITHOUT putting the link in the HEAD section? Or is there a way to have embedded styles on a page without putting this info in the HEAD section?

I'm doing a newsletter and can only customise the BODY section of the HTML - the HEAD section is out of bounds!

I know I could use in-line CSS but that needs loads more text which should be unnecessary when using CSS.

Thanks.

Does it have to be an external style sheet?
You could put the <link> tag outside of the head, could be a bit inconsistent though and it definitely won't validate.

You can use <style>{css rules}</style> any where inside the document, no problem at all.
 
Re: CSS style sheet question

Actually, rereading your post, I think this is what you're getting at:

You can use <style>{css rules}</style> any where inside the document, no problem at all.
 
Re: CSS style sheet question

You can use <style>{css rules}</style> any where inside the document, no problem at all.

Yes, that's what I was on about. Only thing is I have to repeat the same stuff many times rather than just doing it the once.

Oh well, it's not as if I have anything better to do!

Cheers Macky.
 
Re: CSS style sheet question

Yes, that's what I was on about. Only thing is I have to repeat the same stuff many times rather than just doing it the once.

Well, not really. They're not inline styles, it's more like embedding the external stylesheet within the document.

You could just copy the entire contents of your stylesheet and paste it in between two style tags, the style tags can be placed anywhere you like.

It's obviously not quite as convenient as maintaining just one stylesheet, because you'll have to paste it into each html page that needs to use it, but it's a lot better than using inline styles for every element on the page.

If only one html page is ever going to make use of a stylesheet though, this is actually a better way to do it.
 
Re: CSS style sheet question

Is there a way to link to an external style sheet WITHOUT putting the link in the HEAD section? Or is there a way to have embedded styles on a page without putting this info in the HEAD section?

I'm doing a newsletter and can only customise the BODY section of the HTML - the HEAD section is out of bounds!

I know I could use in-line CSS but that needs loads more text which should be unnecessary when using CSS.

Thanks.

Macky's answer will work for this, and is the best solution in your case. I wouldn't advise linking a newsletter to an external CSS file as some email clients will not let it load.

Are you using campaign monitor by any chance? Or even hoping for it to look good in Outlook? If you do I have a few tips to help you.
 
Re: CSS style sheet question

Thanks Macky - I'll try it that way.

Beights - I am using the standard (basic!) newsletter tool that 1and1.co.uk provide and one supplied by a third party that provides product feeds for my company site. Not sure what lies behind them - sorry.

edit: just googled cm and no, not using that!
 
Last edited:
Re: CSS style sheet question

Thanks Macky - I'll try it that way.

Beights - I am using the standard (basic!) newsletter tool that 1and1.co.uk provide and one supplied by a third party that provides product feeds for my company site. Not sure what lies behind them - sorry.

edit: just googled cm and no, not using that!

OK, if you want it to look decent in Outlook 2003 DO NOT use div based layouts, use tables. I know it goes against everything a good designer does, but it just won't work.

Also don't use background images, it won't work.

If you want to see how it will look, save the HTML file and open it in MS Word, Outlook 2003 (and maybe 2007) uses Word to render emails.

This cause me no end of problems recently trying to send newsletters.
 
Re: CSS style sheet question

OK, if you want it to look decent in Outlook 2003 DO NOT use div based layouts, use tables. I know it goes against everything a good designer does, but it just won't work.

Ha! I got caught out by that early last year. Good job for some of us tables never really went out of fashion :icon_bigg

If you want to see how it will look, save the HTML file and open it in MS Word, Outlook 2003 (and maybe 2007) uses Word to render emails.

Thanks for the tip, will do. Cheers.
 
Re: CSS style sheet question

Ah right, I've only just copped it's for an email.Definitely don't use an external stylesheet so.
As Beights said, some clients won't load it, plus if somebody downloads the mail to read offline they'll have the same problem.
In fact, where email clients are concerned, keep everything as simple as possible, html and css.

There is even an argument to be made for going back to prehistoric times and using tables to layout emails, but I'm not going to make it.

*edit* :icon_bigg I was replying after post#7 but got distracted
 
Last edited:
Re: CSS style sheet question

OK, if you want it to look decent in Outlook 2003 DO NOT use div based layouts, use tables.

Am I right in saying that the Outlook 2003 renderer was actually a backwards step from previous versions? I seem to remember reading that somewhere.
 
Re: CSS style sheet question

Am I right in saying that the Outlook 2003 renderer was actually a backwards step from previous versions? I seem to remember reading that somewhere.

I believe it was the other way around actually and my previous post was a lie. Now I think about it, after two bottles of wine admittedly, I think Outlook 2000 and 2007 use Word as a render but 2003 used a decent solution.

http://www.sitepoint.com/blogs/2007/01/10/microsoft-breaks-html-email-rendering-in-outlook/# seems to explain it, but as the aforementioned wine is taking effect, I haven't read most of it.
 
Last edited:
Re: CSS style sheet question

Haha, I knew I'd read something like it and it was that very article.
Sitepoint is my second favouritist site on the Interweb.

midgetsoncrutches.com is my number one, before anybody asks

midgetstakecrutches.gov.uk is better, it's more official like.
 
Re: CSS style sheet question

is a "CSS Style Sheet" a bit like a "PIN number"?
 
Re: CSS style sheet question

No its like a PIN identification number.

somebody found "personal PIN number" and wrote into New Scientist about it, prompting the wag of editor to say "how long before a personal identification PIN number?"

that really is the kind of shit i find funny

:icon_eek:

and yes i read New Scientist

:icon_bigg
 
Re: Cascading Style Sheet cascading style sheet question

You'll probably enjoy the updated thread title so

I know what I wrote :icon_lol:
 
Last edited:
Status
Not open for further replies.
Log in to stop seeing adverts

P Pld Pts
1Liverpool1639
2Chelsea1735
3Arsenal1733
4Nottm F1731
5Bournemouth1728
6Aston Villa1728
7Manchester C  1727
8Newcastle1726
9Fulham1725
10Brighton1725
11Tottenham 1723
12Brentford1723
13Manchester U1722
14West Ham1720
15Everton1616
16Palace1716
17Leicester1714
18Wolves1712
19Ipswich1712
20Southampton176

Latest posts

Back
Top