CSS not being applied

Discussion in 'HTML' started by Dave, Jan 14, 2008.

  1. Dave

    Dave Guest

    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, Jan 14, 2008
    #1
    1. Advertising

  2. Dave

    asdf Guest

    "Dave" <> wrote in message
    news:...
    > 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">
     
    asdf, Jan 14, 2008
    #2
    1. Advertising

  3. Dave

    asdf Guest

    "asdf" <> wrote in message
    news:478acece$0$30858$...
    >
    > "Dave" <> wrote in message
    > news:...
    >> 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>
     
    asdf, Jan 14, 2008
    #3
  4. Dave

    Dave Guest

    On Jan 14, 1:56 pm, "asdf" <> wrote:
    > "asdf" <> wrote in message
    >
    > news:478acece$0$30858$...
    >
    >
    >
    >
    >
    > > "Dave" <> wrote in message
    > >news:...
    > >> 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!
     
    Dave, Jan 14, 2008
    #4
  5. Dave

    Neredbojias Guest

    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.
     
    Neredbojias, Jan 14, 2008
    #5
  6. Dave

    GTalbot Guest

    On 13 jan, 21:46, Dave <> 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.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
    --
    Internet Explorer 7 bugs
    http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
     
    GTalbot, Jan 14, 2008
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott
    Replies:
    0
    Views:
    420
    Scott
    Jul 27, 2003
  2. Angel
    Replies:
    1
    Views:
    386
    Raja Balaji R
    Jan 2, 2004
  3. =?Utf-8?B?TG9yZW5j?=

    Policy not being applied to reference at this time

    =?Utf-8?B?TG9yZW5j?=, Apr 28, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    3,632
    =?Utf-8?B?TG9yZW5j?=
    Apr 28, 2005
  4. Replies:
    0
    Views:
    10,230
  5. Alec MacLean

    Date format strings not being applied?

    Alec MacLean, Oct 31, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    325
    Tim_Mac
    Oct 31, 2006
Loading...

Share This Page