CSS Question

He has: 173 posts

Joined: Nov 2002

Could someone look at the following CSS and tell me why the {color: #ffffff} (which is supposed to be the text color) and the body {bgcolor/background-image:...} are not working? Thanks.

Busy's picture

He has: 6,151 posts

Joined: May 2001

{color: #ffffff;} and {font size: 25pt} aren't assigned to anything
bgcolor is a html term, 'color' is text color, 'background' is background color

if you want these as your body sections, do something like:

body {color:#ffffff; background:#000000; background-image: url(image...);}

and your 'hr'

hr {color: #3cb371; font size: 25pt}

your also missing a end tag '>' on your start tag:

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

Here's a good tutorial on CSS which lays out the basics like this.

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

here's another good tutorial site

He has: 173 posts

Joined: Nov 2002

I think Angelfire must have "eaten" my end tag after "text/css" (no, of course I left it off). Smiling

The {color: #ffffff} thing still isn't working right for the text, though (?). I guess it's one of those "it should, but it doesn't" things or something. I don't really have too much text on there anyway, so I just used instead for now.

I've actually already gone through Busy's discussions of HTML and CSS on EzHTML (how I formed most the CSS in the first place), plus Renegade's CSS tutorial. I really hate reading through a bunch of stuff I will likely never use, so I'm sticking with the basics for now. If I should ever need the more in-depth stuff, then I can always go back and learn that, too.

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

For the text to be a specific size, colour & font you need to assign the css to the attribute for either td, p, or body, etc.

p {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
color: #000066;
}

With that text within the p tag will be the font, size & colour specified in the style sheet.

You really shouldn't mix css and old font tags just because you can't get it to work or you don't understand it as this is just giving up IMO!

Julia - if life was meant to be easy Michael Angelo would have painted the floor....

He has: 173 posts

Joined: Nov 2002

Thanks Julia. Smiling I didn't mean to appear to be giving up . . . but was basically just giving up for the night (which was already near 5am the next day where I am). I am wondering why 4 font types were specified in your post above (Verdana, Arial, Helvetica, and sans-seriff). Why 4 and not only 1?

Suzanne, can I use that CSS validator by just typing in the URL (it asked for what appeared to be the URI), and then it will show me the results just like the XHTML validator does? I won't be able to download a CSS validator, but I'm thinking it should also work the same way as the others.

I almost got a page to validate (had 3 errors) for XHTML 1.0 a while back . . . 2 of the errors being the validator reading as . Not too bad after having so many errors before I guess. However, then you have the errors for affiliate banners (I had over 700 errors one time due to affiliate banners and when I took them off it came down to around 30 . . . then I fixed those and got it down to 3). Sheesh!

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

yes, URI and URL are for your purposes, the same thing.

Busy's picture

He has: 6,151 posts

Joined: May 2001

I am wondering why 4 font types were specified in your post above (Verdana, Arial, Helvetica, and sans-seriff). Why 4 and not only 1?

It's because not all of the fonts are standard, I think it's mac that doesnt have certain ones. but by listing four of the, it will try the first one, if your pc (the viewers) doesnt have it, will try the second one, third one until it finds one it has, if it doesnt find one then it picks a 'sans-serif' font (only one f), if you dont put "serif" or "sans-serief" it will use whatever the dfault font is on your machine, usually times new roman

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

was wondering a bit on how that worked...

The Webmistress's picture

She has: 5,586 posts

Joined: Feb 2001

Well explained Busy Smiling

If you want to do headers slightly fancier in a nice font you can use this to your advantage by specifying your fancy font first, then a list of other more common ones that will still look good and it's then down to the viewers pc to choose which one it's got to display it in.

Julia - if life was meant to be easy Michael Angelo would have painted the floor....

Renegade's picture

He has: 3,022 posts

Joined: Oct 2002

cool! Smiling

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.