/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] css just for one page ?

I have always used a linked stylesheet
using

<link rel=”STYLESHEET” type=”text/css” href=”/yodbod.css”>

Now I just want to use a specific set of CSS for one page

do I write something like:

[CODE]
<script type=”text/css” >

css listing

</script>[/CODE]

and does it go in the HEAD ??

to post a comment
CSS

10 Comments(s)

Copy linkTweet thisAlerts:
@bathurst_guySep 18.2006 — Just create a seperate stylesheet, name it as something different, and in the head add another css link.

<link rel="STYLESHEET" type="text/css" href="/allpages.css">

<link rel="STYLESHEET" type="text/css" href="/justforthispage.css">
Copy linkTweet thisAlerts:
@DaveinLondonauthorSep 18.2006 — Thanks -

but as this html page is going to be sent by email, I need the css IN the page, not in a file and linked.

I would like to put the css at the top of the page - how do I do that ?

My example is pretty close isn't it ?
Copy linkTweet thisAlerts:
@bathurst_guySep 18.2006 — Ah ok sorry.

&lt;style type="text/css"&gt;
&lt;/style&gt;

is the basic version. It depends on what doctype you use, but just run it through the validdator and it will let you know.
Copy linkTweet thisAlerts:
@DaveinLondonauthorSep 18.2006 — yer - silly me ! the style tag :o

I goes that goes in the HEAD ?

and do I use the same notation as in a file

e.g.

[CODE]
<style type="text/css">

.email1{
width:600px;
background-color:#ffff99;
color:#0000ff;
}

</style>[/CODE]
Copy linkTweet thisAlerts:
@bathurst_guySep 18.2006 — Yes. Make sure you set every style though (eg font and background colors, link colours, etc) otherwise they will inherit the properties of the stylesheet that the email is being viewed in (eg hotmail stylesheet etc)
Copy linkTweet thisAlerts:
@DaveinLondonauthorSep 18.2006 — and do I use the same notation as in a file

e.g.

[CODE]
<style type="text/css">

.email1{
width:600px;
background-color:#ffff99;
color:#0000ff;
}

</style>[/CODE]
Copy linkTweet thisAlerts:
@DaveinLondonauthorSep 18.2006 — I tried it like this but it does seem to work ???
Copy linkTweet thisAlerts:
@bathurst_guySep 18.2006 — Yes that's correct.

What you can also do (I know this doesn't make a big difference, but its still cool to know) you can condense your hex colours like so:

#ffff99 can be written as #ff9

As long as characters 1 and 2 are the same, 3 and 4 are the same and 5 and 6 are the same.

Does that make sense?
Copy linkTweet thisAlerts:
@bathurst_guySep 18.2006 — Some email clients cut off everything before the <body> tag, so in this case you may have to make the styles inline, ie&lt;p style="width:100px;"&gt;Paragraph&lt;/style&gt;I recently listened to a Podcast from boagworld.com (number 46 Selling web design services) that touched on html email marketing. They seemed to think that its better to provide just a logo, some brief text and a hyperlink to a page on your website that has the full "html email". Just an idea.
Copy linkTweet thisAlerts:
@DaveinLondonauthorSep 18.2006 — Ok -

thanks for the help.

I have ended up putting the style back in line.

But at least I have formwtted them similarly to my css file:

<tr style = '

background-color:#ccffff;

color:#000;

font-family:Tahoma, Tunga, sans-serif;

font-size:14;

font-weight:bold;

text-align:center; '>

It seems to work fine. ?

As these are just admin notices, I dont want to hassle people to click on a link - but I see what you mean about marketting messages.

Thanks again.
×

Success!

Help @DaveinLondon 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.19,
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,
)...