Forum Moderators: not2easy

Message Too Old, No Replies

p class and span class not matching

         

smkorby

4:43 pm on Jan 25, 2010 (gmt 0)

10+ Year Member



Here is the css:

.bold {
Font-weight: bold;
text-tranform: uppercase:
letter-spacing: .05 em;
color: #000000;
}

Here is the issue. When I apply this style in a span class, it works fine. When I apply it to a tag (exa: <p class=”bold”>) it doesn’t take.

What am I doing wrong? I would like to be able to apply this to a p tag.

encyclo

5:30 pm on Jan 25, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld smkorby :) There are a few errors in your CSS and HTML as quoted that you should address first, as they may affect functionality. Firstly, you should be using lower-case, secondly there is a colon instead of a semi-colon after the "uppercase":

.bold {
Font-weight: bold;
text-tranform: uppercase:
letter-spacing: .05 em;
color: #000000;
}

.bold { 
font-weight: bold;
text-tranform: uppercase;
letter-spacing: .05 em;
color: #000000;
}

For the HTML, the quote marks look wrong - you can't use "curly quotes" as gererated by Word or similar - you should be using only a text editor if you are hand coding:

<p class=”bold”>

<p class="bold">

Try to validate the result with the W3C HTML and CSS validators.

smkorby

6:07 pm on Jan 25, 2010 (gmt 0)

10+ Year Member



Thanks for the quick reply.

The code is valid, except for one thing brought in through aweber that does not affect this. The errors you pointed out are from copy/pasting in/out of Outlook. Here is the original code straight from Dreamweaver.

.bold {
font-weight: bold;
text-transform: uppercase;
letter-spacing: .05em;
color: #000;
}

This does not show the style applied to the paragraph:
<p class="bold">This is the bold class applied to the paragraph.</p>

This shows the style applied correctly:
<p> <span class="bold">This is paragraph text with a span class style of bold.</span></p>

Why does <p class="bold">This</p> not work?