考虑以下代码:
[example.htm]
<link rel="stylesheet" src="myStyle.css" />
<style>
div {margin-left: 100px} /* let's assume this margin value is dynamically generated in PHP/ASP/JSP and we dont't have control over it */
</style>
<body>
<div>foo</div>
<div class="indent-me-more-please">bar</div> <!-- let's assume we don't have control over this part, either -->
</body>
和
[myStyle.css]
.indent-me-more-please {margin-left: * !important}
是否可以将边距值(标记为*
)设置为始终比仅在<style>
标签或元素属性中设置时的值大 50px?在这种情况下:100px+50px = 150px。像“ margin-left += 50px;
”这样的东西,我不知道,相对价值递增?
是否可以在纯 CSS 中做到这一点?