以下是整理網路上的討論並測試出的兩個做法:
- 重覆寫兩個 css 的項目, 但 FF 的項目要在 IE 的之後: 123456789101112131415161718192021222324252627
<
html
>
<
head
>
<
style
>
.container
{
text-align: center;
border: solid 1px blue;
}
.container
{
text-align: -moz-center;
border: solid 1px blue;
}
</
style
>
</
head
>
<
body
>
<
div
class
=
"container"
>
<
table
>
<
tr
>
<
td
>
Text
</
td
>
</
tr
>
</
table
>
<
div
>
</
body
>
</
html
>
- 寫一個項目, 但 IE 的屬性要加上 # 符號(有人測試加 ^ ~ @ # $ % ^ & * ( ) _ + 都可以), 且 IE 的屬性要放在 FF 的屬性之後: 1234567891011121314151617181920212223
<
html
>
<
head
>
<
style
>
.container
{
text-align: -moz-center;
#text-align:center;
border:solid1pxblue;
}
</
style
>
</
head
>
<
body
>
<
div
class
=
"container"
>
<
table
>
<
tr
>
<
td
>
Text
</
td
>
</
tr
>
</
table
>
<
div
>
</
body
>
</
html
>
沒有留言:
張貼留言