• Welcome! The TrekBBS is the number one place to chat about Star Trek with like-minded fans.
    If you are not already a member then please register an account and join in the discussion!

css problem

Deckerd

Fleet Arse
Premium Member
Any ideas why my background colour disappears when I put in position handlers for ul in a style group?

The background works for ordinary text but when I put in a list it disappears. I'm baffled. I'm obviously missing something elementary. It's starting to drive me crazy.
 
Oh ok :(

Incidentally, do you use anything like firebug? It lets you inspect any element of the page and see all the style rules associated with it, it's very good for checking if things have inherited rules from elsewhere, and for ironing out problems.

I think Chrome has something similar built into it now.
 
Damn it didn't work.

I was trying to get a list to work in columns by putting

#test ul {
float: left;
margin: 5px;
}

which works fine but it doesn't show the background colour for some reason.
 
no test is a style, defined by
#test {
width: 800px;
margin: 0 auto;
background-color: #CCCCCC

}

the ordinary text works fine:

#test p {
color:#FFFFFF
margin: 0;
font-size: 100%;

}
but the list doesn't. It must be something to do with the margin. Or the list style.
 
I think what Dennis might be asking is if "test" is being referred to as a class, in which case its referrer would be CLASS="test" in the tag that calls it, or is it named by ID, as in ID="test". Reason being, classes can be referred to multiple times in an HTML page but an ID should be unique, only referenced once per page. Some browsers allow for some slop and multiple ID references, but that's generally not good coding practice. The way you have your SS set up here, it should be called as an ID with the pound symbol "#". Classes use dot-notation "." If it's being called as a class and it's defined this way with a pound symbol, it will have problems doing what you want it to do.
 
It might even be wise to run your page through W3C HTML and CSS validators. They will usually tell you if you are doing something nonstandard which might be breaking your intended functionality.
 
If you are not already a member then please register an account and join in the discussion!

Sign up / Register


Back
Top