如何破解CSS只在IE上使用內聯樣式?如何破解CSS只有在IE瀏覽器上的內聯樣式?
to hack css所有版本的IE只有內聯樣式,我該怎麼辦?
就像那個
<div style = "
color: #eee;
border: 1px solid #000;
for ie only // line-height : 32px;
"/>
如何破解CSS只在IE上使用內聯樣式?如何破解CSS只有在IE瀏覽器上的內聯樣式?
to hack css所有版本的IE只有內聯樣式,我該怎麼辦?
就像那個
<div style = "
color: #eee;
border: 1px solid #000;
for ie only // line-height : 32px;
"/>
<!--[if IE]>
div.classname{
line-height: 32px; //ie only
}
<![endif]-->
來源:http://css-tricks.com/how-to-create-an-ie-only-stylesheet/
編輯:
我想用css內聯 – user3215821
@ user3215821爲什麼?任何具體原因? – JochemQuery
你需要的屬性名稱前加*
,這將只針對IE7,所以你需要編寫此line-height : 32px;
作爲*line-height : 32px;
當我意識到你想爲每一個IE瀏覽器的黑客,所以在這裏你去
_
*
\0
\9
聲明樣式IE10特別是使用CSS只有
@media all and (-ms-high-contrast: none) {
/* This won't go inline but can be used at document level*/
/* Declaration Blocks Goes Here*/
}
您可以瞭解如何使用@media
查詢
儘管如此,我仍然建議您使用條件註釋,這會使您的生活更輕鬆,而不是聲明內聯樣式。
即8,9,10我該怎麼辦? – user3215821
OP要求所有的IE版本,爲什麼你會給IE7具體的建議? – JochemQuery
@JochemQuery我真的不知道我是如何回答只有IE7,我想時間現在睡覺 –
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
#myElement {
/* Enter your style code */
}
}
艱難的任務要做。 –
這個問題是重複的http://stackoverflow.com/questions/4750088/css-display-inline-block-issue-with-ie –
@ViniciusMonteiro這就是IE6/7只有 – JochemQuery