开发者

How to styling the all the form elements

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜