Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Browser not reading style definitions

0 views
Skip to first unread message

Eugene Robinson

unread,
May 19, 2002, 11:51:22 PM5/19/02
to
My first crack at css. I have looked at w3schools.com/css and created an
external style sheet written in WordPad, giving it the ID "Heading".
Inserted the link rel in the header of my web page. Prefixed the required
part of the web page "<id="heading">. My style definitions are not
appearing on the web page. I have checked the syntax etc but am at a loss
as to why it will not display correctly. I changed the <id="heading"> to
<h4> and it displayed as h4, but my definitions were different to h4 - it
still displayed incorrectly therefore. For some reason it looks as if it is
not accessing the link.
Any ideas please ?


Richard Mahoney

unread,
May 21, 2002, 6:05:03 AM5/21/02
to

"Eugene Robinson" <eugene....@btinternet.com> wrote in message
news:edofKn#$BHA.1340@tkmsftngp02...
> Hi
>
> I was not specifying "Font" before <id="heading">. It now reads <Font
> id="heading"> and is working

Um, I hope you don't mean like this:
<font id="heading">Blah blah</font>

This will not work in XHTML as font is no longer supported, if you want to
apply a style to an element on the page use SPAN and CLASS instead:

<style type="text/css">
.mystyle
{
font-family:Arial;
color:#00cc00;
size:140%;
}
</style>

Then in your HTML:

<span class="mystyle">This is an Arial Green font at 140% size...</span>

Remember that ID must only be used once on the page but CLASS can be used as
often as you want.

CLASS has a " . " at the start like this: .mystyle
ID has a " # " at the start like this: #mystyle

Have a look at the CSS 2 Spec at w3.org:

http://www.w3.org/TR/REC-CSS2/

RM.


0 new messages