jquery css(“width“) ,width(),和outerWidth() 的区别

           jquery css("width") ,width(),和outerWidth() 的区别  
            var width1 = btn.css("width");
            // var width = btn.width();
            var width2 = btn.outerWidth();

css(“width”)和outerWidth() 数值一样 只是 css(“width”) 带 px 是字符串

width() 去掉边框 和 内边距 值 比 css(“width”)和outerWidth() 都要小
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_25261441/article/details/109597893
今日推荐