<head>
<style>
.cdm-tb { width: 960px; height: 90px; }
</style>
<script>
ChangeCssRule(".cdm-tb", "width", "468px");
ChangeCssRule(".cdm-tb", "height", "60px");
</script>
</head>
<body>
<img src='images/testimage.jpg' class='cdm-tb' alt='test' />
</body>
ChangeCssRule은 작동하는 JS 기능입니다. 그러나 몇 가지 미디어 쿼리를 .cdm-tb 스타일에 추가하면 CSS 규칙 업데이트가 더 이상 작동하지 않습니다.미디어 쿼리가 미디어 규칙을 업데이트 할 때 CSS 규칙 수정이 실패하는 이유
<style>
.cdm-tb { width: 960px; height: 90px; }
@media(min-width: 728px) {.cdm-tb { width: 728px; height: 90px; } }
@media(min-width: 960px) {.cdm-tb { width: 960px; height: 90px; } }
</style>
미디어 쿼리와 관련된 실행 순서가 있습니까? 모든 제안을 부탁드립니다.
테스트 사례를 만들 수 있습니까? http://jsfiddle.net/ – thirtydot
jsfiddle에 익숙하지 않아서 가능합니다. 다음은 테스트입니다. http://www.pcbuilderplus.com/test/index.html 및 http://www.pcbuilderplus.com/test/index2.html. 미디어 쿼리가 추가되었습니다. –