...

View Full Version : External Style Sheets



titanic_fanatic
07-09-2005, 06:00 AM
I'm just wondering if there is a difference in the way that you write an external style sheet as opposed to including the css in the html document?

The reason that I ask is that my contact form had styled submit buttons:


submit {

font-weight: bold;
font-size: 12px;
border: #c0c0c0 inset 2px;

}

submit.hover {

font-weight: bold;
font-size: 12px;
border-bottom: #cc0000 inset 2px;
border-right: #cc0000 inset 2px;
border-left: #ff0000 inset 2px;
border-top: #ff0000 inset 2px;

}

Which I use this javascript to make this effect compatible with both 'IE' and 'NN':


<input onfocus="this.className='hover'" onblur="this.className=''" onMouseover="this.className='hover'" onMouseout="this.className=''" type="submit" name="submit" id="submit" value="Submit">

It works fine on my contact form where the css is in the html document, but when I try to incorporate this into an external style sheet for my site search engine, with the same javascript, this effect doesn't work. Why would this be?

I do know that the styles that I incorporated into this external sheet are somewhat functional. The text box, when activated gets a red border and in 'NN' when the select field is activated, it gets a red border too, but I can't seem to get this to work for the life of me.

I even tried:


input[type=submit]

but this only works in 'NN'.



My Files

Search Form:

http://www.rollersports.ca/cgi-bin/search/search.cgi

External Style Sheet:

http://www.rollersports.ca/css/search.css

Contact form:

http://www.rollersports.ca/contacts.htm



Any help would be greatly appreciated.

Titanic Fanatic

_Aerospace_Eng_
07-09-2005, 06:55 AM
Try taking out the word submit before .hover and lose this input[type=submit] well the [type=submit] part anyways, thats causing it not to work, and you say that it has to be inside of an element that has an id of search but is in an element called box which isn't right either, this should work.

#box submit {

font-weight: bold;
font-size: 12px;
border: #c0c0c0 inset 2px;

}

/* Submit Button Hover State */
#box .hover {

font-weight: bold;
font-size: 12px;
border-bottom: #cc0000 inset 2px;
border-right: #cc0000 inset 2px;
border-left: #ff0000 inset 2px;
border-top: #ff0000 inset 2px;

}
Given that the input submits are inside of an element that has an id of box

titanic_fanatic
07-09-2005, 08:22 AM
It worked like a charm. Thanks for your help.

Titanic Fanatic :thumbsup:

Bill Posters
07-09-2005, 08:42 AM
submit {



}

submit.hover {



}



#box submit {
Fwiw, you are both using submit as though it were an element, which is incorrect.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum