Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How do I apply a CSS to the whole page?

Reply
Thread Tools

How do I apply a CSS to the whole page?

 
 
OM
Guest
Posts: n/a
 
      09-02-2003
It's probably really simple, but how do I apply a CSS to an entire page?
I've only just recently learned about CSS... so I'm a bit lost.

At the moment, I'm having to apply to every bit of text that I write.
Can't I just add a bit of code to make the style apply to the whole document
or something?

Any help would be appreciated.

Thanks.


OM


 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      09-02-2003
OM wrote:

> It's probably really simple, but how do I apply a CSS to an entire page?


Depending on what exactly you are trying to achieve, something like:

body {
font-family: serif;
}

might be what you are looking for.


--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
 
 
 
SeeSchloss
Guest
Posts: n/a
 
      09-02-2003
Well maybe you should try to find a tutorial on internet to learn more
about css.

Seeing what you said, I guess you using style="property:value;" in you
tags.
If you want to apply the tags to the whole document, you can either add
a reference to an external stylesheet : <link rel="stylesheet"
type="text/css" href="style.css" /> where style.css if the name of the
file where your styles are saved (between <head> and </head>) or define
it at the beginning of your document (but I can't tell you how to do it
and anyway I think that external stylesheets are better).

This way if you want for example a special formating for all your
external links, add class="external" in your links (<a href="address"
class="external">...</a>) and in you stylesheet, add :

a.external
{
text-decoration:underline;
other declarations;
}

More generally, you must define styles in the sheet this way :
tagname.class
{
property:value;
}

I'm not sure this is well explained, I think you should search a good
tutorial instead


> It's probably really simple, but how do I apply a CSS to an entire page?
> I've only just recently learned about CSS... so I'm a bit lost.
>
> At the moment, I'm having to apply to every bit of text that I write.
> Can't I just add a bit of code to make the style apply to the whole document
> or something?
>
> Any help would be appreciated.
>
> Thanks.
>
>
> OM




 
Reply With Quote
 
Phrederik
Guest
Posts: n/a
 
      09-03-2003

"OM" <(E-Mail Removed)> wrote in message
news:Bq85b.453$(E-Mail Removed)...
> It's probably really simple, but how do I apply a CSS to an entire page?
> I've only just recently learned about CSS... so I'm a bit lost.
>
> At the moment, I'm having to apply to every bit of text that I write.
> Can't I just add a bit of code to make the style apply to the whole

document
> or something?


It looks like the answers may be missing an important point.

If you want your STYLEs to apply to the whole page put the following inside
of your HEAD tags...

<style>
body { font-family: serif; }
someattribute { someProperty: someStyleValue; someProperty:
someStyleValue; }
</style>

.... and the attributes will all have their style applied on the whole page.

You can also make a CSS file with your styles in it. The file looks the same
as what would go inside of the STYLE tags. Then you'd add the following to
any page that you want that style file to apply to...

<link href="styles.css" rel="stylesheet" type="text/css">

....AND, if you are going to have pages for printing, you might want to make
a custom STYLEs CSS file just for printing. Include it as:

<link href="print.css" rel="stylesheet" type="text/css" media="print">

Hope this helps a bit!



 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
*WITHOUT* using: ValidateRequest="False" for the whole page (or my whole site).... \A_Michigan_User\ ASP .Net 2 08-21-2006 02:13 PM
Apply style changes to a whole CSS class Waffeloo Javascript 3 09-19-2005 11:34 PM
Easy way to apply URLEncode() to a whole DataTable? MattB ASP .Net 0 08-31-2004 10:37 PM
How can I make it apply to whole document? Hari Prakash XML 1 07-16-2004 12:09 PM
[XSLT] could not apply "apply-templates" Stefan Siegl XML 1 07-18-2003 09:43 AM



Advertisments