开发者

How to get common style for FF and IE

开发者 https://www.devze.com 2023-03-08 14:09 出处:网络
I have something like <b> sample text <b> renders diffently in IE and FF In IE like <Strong>sample text</Strong>

I have something like <b> sample text <b> renders diffently in IE and FF

In IE like <Strong>sample text</Strong>

In FF something like <font style="font:bold">Sample Text<开发者_如何学运维/Font>

how to get common style or convert any one of it to another

Thanks


Use CSS to style your page.

strong {
    font-weight:bold;
}


try

     <span style="font-weight:bold"> sample text </span>

also you can use css shorthand like

           <span style="font:bold 13px arial;"> sample text </span>

Note: <font> has been deprecated

Reference

https://developer.mozilla.org/en/CSS/font-style

https://developer.mozilla.org/en/CSS/font


If you need to simply differentiate the CSS inclusion you can use the IE conditions in HTML :

<![if IE]>
<link rel="stylesheet" type="text/css" href="ie.css" />
<![endif]>

and for all the other cases

<![if !IE]>
<link rel="stylesheet" type="text/css" href="not-ie.css" />
<![endif]>

If you need something more specific you will have to use some hacks, but it's not recommended at all

0

精彩评论

暂无评论...
验证码 换一张
取 消