p em <- what's wrong?

They have: 2 posts

Joined: Mar 2006

Hello all,

I'm a novice to both html and CSS and I'm having trouble using the following external style:

p { color: black;
font-weight: bold ;
background-color: white ; }
p em { background-color: = gray ; color:= red; }

If I read the CSS spec correctly, that should produce red text on a gray background for all emphasized text that is in a paragraph. Nothing I define in the decendant to p seems to have any effect at all.

The paragraph I'm using the emphasized text in contains the following:

... bla bla bla At the moment, I am a novice web developer so please be patient. I will be posting examples and short tutorials on the use and installation of new (to me) technologies as I learn them.

What am I doing wrong?

Thanks for your help.

Scott

Busy's picture

He has: 6,151 posts

Joined: May 2001

p, em { background-color: gray ; color:red; }

you need a comma between html tags elements and remove the equals sign

They have: 2 posts

Joined: Mar 2006

I think I'm going to shoot myself. :blush:

I stared at that until my eyes were bleeding.

augh!!!!!!!

THANK YOU.

Busy's picture

He has: 6,151 posts

Joined: May 2001

A very common mistake dont beat yourself up it.
Is good to get another set of eyes on to something you get stumped on, or take a break and come back to it. It's usually the smallest things too.

Welcome to TWF btw

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.