|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to create CSS rule that applies ONLY to INPUT element which type is SUBMIT
So, what would I like to have?
A css rule that would affect visual appearance of only the <input type="submit"> elements (or any other sub-type of <input>, but again, affecting that sub-type only). Is it possible to do? How? I have a lot of .NET pages with a LOT of submit buttons (within datagrids and regular buttons too). There is a way to do it programaticaly in source code of .NET pages, but I'd like an elegant solution like css, which could be done without recompiling entire project. Any help is highly appreciated. |
|
#2
|
||||
|
||||
|
you can use attribute selectors
input[type=submit] { border:1px solid #000; } http://www.w3.org/TR/CSS21/selector...ibute-selectors but ofcourse this does not work in msie, work in every other modern browser mozilla, opera, safari. |
|
#3
|
|||
|
|||
|
Thanks a lot, that solves the part of the puzzle. But what about IE? No such elegant (or less elegant) way?
|
|
#4
|
||||
|
||||
|
You could, of course, browser-sniff and tell folks with IE to upgrade to a modern browser. Hmmm, that sounds familiar
. Since you're in a .NET environment, I doubt that's a popular or satisfactory solution. ![]() Use a class definition and apply the class to each input[submit]. Not pretty, but a search and replace should make it relatively painless. cheers, gary
__________________
There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing. My html and css workshop, demos and tutorials. Ask a better question, get a better answer. |
|
#5
|
||||
|
||||
|
Quote:
Yes, not very satisfactory solution indeed ![]() Quote:
Well, I'll delve into the dark depths of the .NET framework and try to do it as painless as possible. An idea or two are already brewing inside my mind ![]() Thanks guys, Miran |
|
#6
|
|||
|
|||
|
I think this would work for you. Just need to give each submit button a class attribute.
Code:
<style type="text/css">
.submit
{
border:1px solid #000;
}
</style>
<body>
<input name="submit" type="submit" class="submit">
</body>
Hope that helps, Cuda edit ---> Sorry didn't see this already sugested my bad. |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > How to create CSS rule that applies ONLY to INPUT element which type is SUBMIT |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|