Results 1 to 4 of 4

Thread: I need help with an HTML code!!!!

  1. #1
    Join Date
    Aug 2006
    Posts
    235
    Thanks
    30
    Thanked 2 Times in 2 Posts

    Question I need help with an HTML code!!!!

    Ok. i have this code:
    <style type="text/css">
    }
    a.nav:link, a.nav:visited, a.nav:active {
    text-decoration: none;
    font-family:Century Gothic ;
    font-style: bold;
    font-size: 9pt;
    line-height: pt;
    color: 000000 ;
    background-color: ;
    cursor: default;
    display: block;
    margin: 0;
    margin-bottom: 2px;
    padding: 0px;
    padding-left: 1px;
    padding-right: 1px;
    }
    a.nav:hover {
    text-decoration: none;
    font-family: ;
    font-style: bold;
    font-size: 10pt;
    line-height: 0pt;
    color: gggggg;
    background-color: gggggg;
    cursor: default;
    display: block;
    margin: 0;
    margin-bottom: 2px;
    padding: 0px;
    padding-left: 1px;
    padding-right: 1px;

    }
    </style>
    and im trying to use it on my HTML freewebs. I put it on my old freewebs and it worked but now i want to put it on my new one and it isn't working.

    is there anything wrong with it?

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    What's not working about it?
    Generally, # is used before colors.... like #000000 for black. Also, capitalize the letters in them. I don't think that's required, but the normal way to do it.


    Nothing else is jumping out at me.

    Except, I guess, this looks somewhat unusual:
    1. line-height: pt; >> you should have something there, not just pt... 1pt? 3? Remove if you don't want a value there.
    2. color: 000000 ; >> why's there a space before the semicolon? Not sure if that's required.
    3. background-color: ; >> No value here. Remove this line. And the space, again.

    There are a few spots in the code like that.

    I'm no CSS expert, but maybe some of this will help.

    Might also be how you added it to your page.
    Might also be a new "feature" of freewebs. They don't allow some code, etc., so this may now be blocked, but likely not if you used it on your other site recently. If it's been a while, that might be worth looking into.


    Also, this isn't HTML. It's CSS... Cascading Style Sheet... formatting, rather than content. Html is things like <b>bold</b>, etc.
    Please post in the CSS section next time.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    This is ugly.
    Code:
    <style type="text/css">
    } /* This brace shouldn't be here. */
    a.nav:link, a.nav:visited, a.nav:active {
      text-decoration: none;
      font-family:Century Gothic ; /* You should specify a generic font family, such as sans-serif. */
      font-style: bold; /* This isn't a valid font-style.  You probably want font-weight. */
      font-size: 9pt; /* Points are a print size, and shouldn't be used for anything that will be displayed onscreen. */
      line-height: pt; /* Again, don't use points except on a print stylesheet, and you haven't specified a value. */
      color: 000000 ; /* Hex colours need to be prefixed with #. */
      background-color: ; /* This is not a valid value.  Try "transparent". */
      cursor: default;
      display: block;
      margin: 0;
      margin-bottom: 2px;
      padding: 0px; /* these three */
      padding-left: 1px; /* lines are */
      padding-right: 1px; /* redundant. */
      /* padding: 0 1px; /* This can be used instead. */
    }
    
    a.nav:hover {
      text-decoration: none;
      font-family: ; /* This is not a valid font family. */
      font-style: bold; /* Again, see font-weight. */
      font-size: 10pt; /* Tsk, points. */
      line-height: 0pt; /* 0 doesn't need a unit. */
      color: gggggg; /* Colours need to be prefixed with #, and G is not a valid hex digit. */
      background-color: gggggg; /* Ditto. */
      cursor: default;
      display: block;
      margin: 0;
      margin-bottom: 2px;
      padding: 0px; /* These */
      padding-left: 1px; /* lines */
      padding-right: 1px; /* as above. */
    }
    </style>
    Try:
    Code:
    <style type="text/css">
    a.nav:link, a.nav:visited, a.nav:active, a.nav:hover {
      text-decoration: none;
      font-family: "Century Gothic", sans-serif;
      font-weight: bold;
      font-size: 0.9em;
      line-height: 0;
      color: #000000;
      background-color: transparent;
      cursor: default;
      display: block;
      margin: 0;
      margin-bottom: 2px;
      padding: 0 1px;
    }
    
    a.nav:hover {
      font-size: 1em;
      color: #ffffff;
      background-color: #000000;
    }
    </style>
    Notes: I have no idea what "gggggg" is meant to be, so I've guessed those colours. Also, I've assumed that 10pt == 1em, which won't always be the case -- they're different types of unit.
    Quote Originally Posted by djr33
    why's there a space before the semicolon? Not sure if that's required.
    It's not required, but not a problem either.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Well, ok. But still, as pointed out by Twey, try to stick to standards.... that's messy.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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
  •