我正在处理某些事情,并在此处卡住。我使用jQuery使用此功能来改变文字:在jQuery中使用<style>标记链接内容
$('.css').text(newval);
好,有一个小的转折。我不想更改<style>
标记内的内容。 如果我将一个类添加到<style class="css">
但它只适用于所有媒体,效果很好。 我不想用@media only screen and (min-device-width: 1024px0)
来代替它。有没有办法改变里面的文字?即使它使用不同的方法。
你的意思是你想要的内容文本在不同的屏幕尺寸不同? –
显示了你的风格标记和你想要的内容 – Apolo
我不确定,但是你不能这样做:document.querySelector('style')。textContent + =“@media screen and(min -device-width:1024px){div {color:red;}}“ –