resizing a BUTTON through CSS

前端 未结 3 1066
闹比i
闹比i 2020-11-27 23:14

I use jquery mobile to generate my buttons and I have a CSS code below to change its design but no matter what value i put in width and height the size of the button doesn\'

3条回答
  •  没有蜡笔的小新
    2020-11-27 23:55

    Live Example:

    • http://jsfiddle.net/3EgrW/21/ (Width)
    • http://jsfiddle.net/3EgrW/35/ (Height)

    JS:

    // For all buttons use something like this
    $('.ui-btn').css('width','50%');
    
    // For individual buttons use something like this
    $('#theButton1').parent().css('width', '75%');
    
    // Or this for HREF data-role buttons
    $('#hrefButton4').css('width', '45%');
    

    UPDATE: (I think this is what you're looking for)

    // this changes the height for all buttons
    $('.ui-btn-text').css('font-size','50px');
    
    // This changes the height for a single element 
    $('#hrefButton3').children().children().css('font-size','30px');
    

    HTML:

    
    

提交回复
热议问题