How to style all the form elements of a 开发者_如何学Goweb page (including checkbox, radio, file, etc)
If I need to use a jQuery plugin, then which is the best?
Something like this (css) ?
form input {
//your style rules here
}
If you really need to do this dynamic, with jQuery you can also do:
$('form input').css({ 'color' : 'red' });
Or perhaps:
$('form input').addClass('my-input');
css:
input.my-input {
// style rules here.
}
you can use .css()
of jquery..
$('#formId input').css({ 'color' : 'red' });
$("form > *")
.css( { prop1: value1, prop2:value2 } );
// here propXXX= any css property like color/margin and valueXXX= any reasonable value for the property
精彩评论