Log in

View Full Version : I need help with an HTML code!!!!



ModernRevolutions
10-07-2006, 12:55 AM
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?

djr33
10-07-2006, 08:55 AM
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.

Twey
10-07-2006, 11:04 AM
This is ugly.
<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:
<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.
why's there a space before the semicolon? Not sure if that's required.It's not required, but not a problem either.

djr33
10-07-2006, 11:54 PM
Well, ok. But still, as pointed out by Twey, try to stick to standards.... that's messy.