Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > CSS not being applied

Reply
Thread Tools

CSS not being applied

 
 
Dave
Guest
Posts: n/a
 
      01-14-2008
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.
 
Reply With Quote
 
 
 
 
asdf
Guest
Posts: n/a
 
      01-14-2008

"Dave" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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">


 
Reply With Quote
 
 
 
 
asdf
Guest
Posts: n/a
 
      01-14-2008

"asdf" <(E-Mail Removed)> wrote in message
news:478acece$0$30858$(E-Mail Removed)...
>
> "Dave" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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">
>


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

Also replace:

</script>

with:

</style>


 
Reply With Quote
 
Dave
Guest
Posts: n/a
 
      01-14-2008
On Jan 14, 1:56 pm, "asdf" <(E-Mail Removed)> wrote:
> "asdf" <(E-Mail Removed)> wrote in message
>
> news:478acece$0$30858$(E-Mail Removed)...
>
>
>
>
>
> > "Dave" <(E-Mail Removed)> wrote in message
> >news:(E-Mail Removed)...
> >> 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">

>
> ...and before the pedants get me...
>
> Also replace:
>
> </script>
>
> with:
>
> </style>


I am such a knob!

Cheers mate!
 
Reply With Quote
 
Neredbojias
Guest
Posts: n/a
 
      01-14-2008
Well bust mah britches and call me cheeky, on Mon, 14 Jan 2008 03:14:25
GMT Dave scribed:

>> >> 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">

>>
>> ...and before the pedants get me...
>>
>> Also replace:
>>
>> </script>
>>
>> with:
>>
>> </style>

>
> 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>

--
Neredbojias
Riches are their own reward.
 
Reply With Quote
 
GTalbot
Guest
Posts: n/a
 
      01-14-2008
On 13 jan, 21:46, Dave <(E-Mail Removed)> wrote:
> 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.htm...ef-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/docs...te_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/docs...my_CSS_code.3F

Why we won't help you by Mark Pilgrim
http://diveintomark.org/archives/200..._wont_help_you

Regards, Gérard
--
Internet Explorer 7 bugs
http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Configuration Error" (Policy not being applied to reference at this time) matt.delvecchio@shell.com ASP .Net 0 06-12-2006 02:09 PM
Wireless Policy Not Being Applied Ben Wireless Networking 0 01-06-2006 04:04 PM
Policy not being applied to reference at this time =?Utf-8?B?TG9yZW5j?= ASP .Net 0 04-28-2005 02:54 PM
Style Not being applied in HTML event Angel ASP .Net 1 01-02-2004 12:47 PM
Styles not being applied with RegisterClientScriptBlock Scott ASP .Net 0 07-27-2003 12:23 AM



Advertisments