SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS Classes Not Working...

    I just started to become familiar with CSS (again), and I've stumbled accross a problem.
    The classes I set in CSS aren't being applied to the HTML page when displayed.
    Here is the following code:
    Code:
    <html>
    <head>
    <style="text/css">
    <!--
    input {
    border: 1px solid #6291B0;
    background: #91ACBC;
    padding-right: 4;
    padding-left: 4;
    padding-top: 1;
    padding-bottom: 1;
    }
    .blah {
    font-color: blue;
    font-size: 20;
    }
    -->
    </style>
    <body bgcolor="#B9CCD7">
    <input type="submit" value="  Join!  ">
    <p>
    <font class="blah">WORK GOD DAMN YOU!</font>
    </body>
    </head>
    </html>
    And the page can be viewed here http://star-craftx.com/test.html.

    But they DO work when I apply them directly to the tag, like so:
    Code:
    <input stlye="border: 1px solid #6281B0; background: #91ACBC;" type="submit" value="GO!">
    Either I've fallen behind in the times, or I'm doing something wrong which I don't realize.

  2. #2
    Ceci n'est pas Zoef Zoef's Avatar
    Join Date
    Nov 2002
    Location
    Malta
    Posts
    1,111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not like this:
    Code:
    <style="text/css">
    But like this:
    Code:
    <style type="text/css">
    Have fun with it!

    Rik
    English tea - Italian coffee - Maltese wine - Belgian beer - French Cognac

  3. #3
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, the humor of stupidty.

    Thanks bro!

  4. #4
    Ceci n'est pas Zoef Zoef's Avatar
    Join Date
    Nov 2002
    Location
    Malta
    Posts
    1,111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're welcome mate!

    Don't worry about it! No such thing as a smart mistake!

    Rik
    English tea - Italian coffee - Maltese wine - Belgian beer - French Cognac

  5. #5
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,556
    Mentioned
    183 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    <font class="blah">WORK GOD DAMN YOU!</font>


    One of the benefits of CSS is that you can get rid of the horrible font tag - and here you go using it to apply your css .

    Put the class in the <p> tag that you have before it and you will save yourself code as well.

    e.g.
    Code:
    <p class="blah">WORK GOD DAMN YOU!</p> 
    Hope this helps

    Paul

  6. #6
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by koomann
    Code:
    <html>
    <head>
    <style="text/css">
    <!--
    input {
    border: 1px solid #6291B0;
    background: #91ACBC;
    padding-right: 4;
    padding-left: 4;
    padding-top: 1;
    padding-bottom: 1;
    }
    .blah {
    font-color: blue;
    font-size: 20;
    }
    -->
    </style>
    <body bgcolor="#B9CCD7">
    <input type="submit" value="  Join!  ">
    <p>
    <font class="blah">WORK GOD DAMN YOU!</font>
    </body>
    </head>
    </html>
    And the page can be viewed here http://star-craftx.com/test.html.

    But they DO work when I apply them directly to the tag, like so:
    Code:
    <input stlye="border: 1px solid #6281B0; background: #91ACBC;" type="submit" value="GO!">
    You need to specify a unit of measure for padding and margins, like "4px" rather than just "4".

  7. #7
    Ceci n'est pas Zoef Zoef's Avatar
    Join Date
    Nov 2002
    Location
    Malta
    Posts
    1,111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now you guys are making me look lazy !

    Rik
    English tea - Italian coffee - Maltese wine - Belgian beer - French Cognac


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •