CSS not being applied

D

Dave

The following embedded CSS class is not being applied and I don't
under stand why?

Any help would be appreciated.

<script type="text/css">
.msg_alert {
text-weight: bold;
font-size: 1em;
color: red;
}
</script>

<div class="msg_alert">This should work!</div>

Thanks in advance.
 
A

asdf

Dave said:
The following embedded CSS class is not being applied and I don't
under stand why?

Any help would be appreciated.

<script type="text/css">
.msg_alert {
text-weight: bold;
font-size: 1em;
color: red;
}
</script>

<div class="msg_alert">This should work!</div>

Thanks in advance.

Try replacing:

<script type="text/css">

....with:

<style type="text/css">
 
A

asdf

asdf said:
Try replacing:

<script type="text/css">

...with:

<style type="text/css">

....and before the pedants get me...

Also replace:

</script>

with:

</style>
 
N

Neredbojias

Well bust mah britches and call me cheeky, on Mon, 14 Jan 2008 03:14:25
GMT Dave scribed:
I am such a knob!

Cheers mate!

Wow, how ironic! When I read your original posting, I thought to myself,
"This guy is dumber than a doorknob." Btw, is your first name
"Dangerous"?

<grin>
 
G

GTalbot

The following embedded CSS class is not being applied and I don't
under stand why?

Any help would be appreciated.

<script type="text/css">
.msg_alert {
text-weight: bold;
font-size: 1em;
color: red;
}
</script>

<div class="msg_alert">This should work!</div>

Thanks in advance.

Dave,

text-weight is not a valid CSS property name. font-weight is:

http://www.w3.org/TR/CSS21/fonts.html#propdef-font-weight

If you had checked your code with a HTML validator or an online HTML
validation service and with a CSS validator, both errors (<script>
instead of <style> and text-weight) would have been reported.

Reading suggestions:

Using Web Standards in your Web Pages:Making your page using web
standards - how to
2.1 Where can I validate my webpages? How to validate webpages?
http://developer.mozilla.org/en/doc...te_my_webpages.3F_How_to_validate_webpages.3F

Using Web Standards in your Web Pages:Making your page using web
standards - how to
3.1 Where can I validate my CSS code?
http://developer.mozilla.org/en/doc..._-_how_to#Where_can_I_validate_my_CSS_code.3F

Why we won't help you by Mark Pilgrim
http://diveintomark.org/archives/2003/05/05/why_we_wont_help_you

Regards, Gérard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top