Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/423.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
更改现有div类的边距(javascript) bs_Javascript_Html - Fatal编程技术网

更改现有div类的边距(javascript) bs

更改现有div类的边距(javascript) bs,javascript,html,Javascript,Html,右边距设置为30px。如何将其更改为10px?我不喜欢内联应用样式。我将添加一个实用程序类 <div class="name">bs</div> (reference to your div).style.marginRight = 10+'px'; 你的目标浏览器是什么?问题中没有提到jQuery。它也没有解决OP的问题 $("element_id").addClass("utilityClassname");

右边距设置为30px。如何将其更改为10px?

我不喜欢内联应用样式。我将添加一个实用程序类

<div class="name">bs</div>
(reference to your div).style.marginRight = 10+'px';

你的目标浏览器是什么?问题中没有提到jQuery。它也没有解决OP的问题
$("element_id").addClass("utilityClassname");