我正在为网站设置主题 http://www.complementchic.com
所以在我的CSS中,我设置了主体的CSS来调整图像大小
http://www.complementchic.com/modules/vente_flash/flashSale.php
#module-vente_flash-flashSale
但是当我通过页面切换语言时 php post url 变为:
http://www.complementchic.com/modules/vente_flash/flashSale.php?&id_lang=2
因此我在 css 中的 body id 更改为
#module-vente_flash-flashSale?&id_lang=2
并且我无法在我的 CSS 样式表中使用此 ID -
那么,a) 有没有办法让我在样式表中使用此 ID 或解决此问题,
最佳答案
尝试使用 CSS 属性选择器:
HTML:
<body id="module-vente_flash-flashSale?&id_lang=2">
This is a text here
</body>
CSS:
body[id="module-vente_flash-flashSale?&id_lang=2"] {
background-color: red; /* for example */
}
<强> jsBin 演示
关于php - CSS通过包含查询字符串的id选择元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13251007/