[英]How to set child width equal to parent width minus x px by js or jquery?
I try to set width of child element according to parent width - x px. 我尝试根据父宽度-x px设置子元素的宽度。 what's wrong in my code :
我的代码有什么问题:
$("#formTable table:first-child").css("width",$("#Content").css("width")-5)
where formTable is child of Content. 其中formTable是Content的子级。
使用此代码:
$("#formTable table:first-child").css("width",$("#Content").width()-5)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.