开发者

How to styling the all the form elements

开发者 https://www.devze.com 2023-03-09 12:07 出处:网络
How to style all the form elements of a 开发者_如何学Goweb page (including checkbox, radio, file, etc)

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
0

精彩评论

暂无评论...
验证码 换一张
取 消