4 replies [Last post]
walshbj
Offline
newbie
Last seen: 14 years 8 weeks ago
Joined: 2006-10-06
Posts: 3
Points: 0

I'm VERY new to CSS - please bear with me. If I put the .centertext class above the h4 entry in the style sheet it is ignored. (see CSS below) The part I don't understand is that it's ignored for both h4 AND the p element that reference the class in my html. I can see where h4 will override .centertext if h4 is further down. But why is the p element affected by this? The style sheet is very simple, not much else on it.
Essentially, I need to put the code in the order below to have the p element get centered.

There is an entry for p futher down in the css but it does not deal with alignment. Just font size and family.

h4 {

margin:0;

padding: 5px 0;

}

.centertext {
text-align:center;
}

DanA
DanA's picture
Offline
Elder
Last seen: 10 years 29 weeks ago
Timezone: GMT+2
Joined: 2004-08-14
Posts: 1087
Points: 2

Can you provide a link or

Can you provide a link or post the css and html code?
The problem must be elsewhere.

walshbj
Offline
newbie
Last seen: 14 years 8 weeks ago
Joined: 2006-10-06
Posts: 3
Points: 0

Two css files and one html

Two css files and one html here:
http://thelamargroup.net/csspractice/

one css is for layout, the other one is the one I'm tinkering with.
It's pretty messy, I'm just trying to learn what I can as fast as possible.

The html that is not behaving as I expect is the stuff in the right column.

http://thelamargroup.net/csspractice/

Thanks so much.
PS: the path at the top of the right column is a stray that I must have accidently pasted in before uploading this thing. That's not my question!! (I'm removing it now)

DanA
DanA's picture
Offline
Elder
Last seen: 10 years 29 weeks ago
Timezone: GMT+2
Joined: 2004-08-14
Posts: 1087
Points: 2

There's a problem with the

There's a problem with the comments in your stylesheet(with Presentation Stylesheet) :
part of the body declaration is interpreted/dropped (?) as you cannot nest comments that way.
You have 13 css errors.
Validate your HTML (look for the satay method)

walshbj
Offline
newbie
Last seen: 14 years 8 weeks ago
Joined: 2006-10-06
Posts: 3
Points: 0

Thank you!

Nested comments! Should have seen that. I am working through the Eric Meyer - O'Reilly book. I have a long way to go. But when I fixed those comments at the top the problem went away.

Thank you very much.