Bob Hoffman
asked on
How do I create a global CSS statement for all input fields on all my .aspx pages
Is there a way to define a global style that will cover all the input elements throughout my site? I don't want to have to assign the style to each element (ie cssClass=).
Something like: BODY {font-family: serif; background-color: silver;} only to cover asp:textbox, asp:dropdownlist, etc.
tried INPUT.TEXT{ }.... this doesn't work
Thanks
Something like: BODY {font-family: serif; background-color: silver;} only to cover asp:textbox, asp:dropdownlist, etc.
tried INPUT.TEXT{ }.... this doesn't work
Thanks
If you just mean asp.net controls, you can use asp.net skins file:
http://www.codeproject.com/KB/aspnet/ThemesAndSkins.aspx
http://msdn.microsoft.com/en-us/library/ykzx33wh.aspx
http://www.codeproject.com/KB/aspnet/ThemesAndSkins.aspx
http://msdn.microsoft.com/en-us/library/ykzx33wh.aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can do it in 2 different ways, first method is to write css codes direct for input elements e.g.
input[type=text]
{
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding:4px;
font:12px;
}
in the above mentioned codes you are writing codes to apply directly on input type. and wherever you'll use in html <input type="text"............. /> these codes will automatically apply to all inputs.
But you can do the same thing in another way, first write a style class and then apply to the concerning elements e.g.
.textEntry
{
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding:4px;
font:12px;
}
now you have a class named 'textEntry' in your css and you can apply this class to the elements for example:
<input class="textEntry" type="text size="25" value="" />
hope this will be helpful to you.
input[type=text]
{
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding:4px;
font:12px;
}
in the above mentioned codes you are writing codes to apply directly on input type. and wherever you'll use in html <input type="text"............. /> these codes will automatically apply to all inputs.
But you can do the same thing in another way, first write a style class and then apply to the concerning elements e.g.
.textEntry
{
-moz-border-radius: 5px;
-khtml-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
padding:4px;
font:12px;
}
now you have a class named 'textEntry' in your css and you can apply this class to the elements for example:
<input class="textEntry" type="text size="25" value="" />
hope this will be helpful to you.
ASKER
This did the trick... added "select" to handle the dropdown lists.
input, textarea, select {}
Thanks everyone.
input, textarea, select {}
Thanks everyone.
Open in new window