字体家族是否有解决方法:IE7的继承 [英] Is there a workaround for font-family: inherit for IE7

查看:81
本文介绍了字体家族是否有解决方法:IE7的继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个CSS类:

text_css

我要在其中应用继承属性.这对于IE8和IE9正常工作.我知道继承不适用于IE7.

in which i want to apply the inherit property.this is working fine for IE8 and IE9. i know inherit dont work for IE7.

有人可以为此建议任何解决方法吗?

can anyone suggest any workaround for this?

推荐答案

解决方法是将属性设置为应继承的特定值.这是否可行取决于上下文.

The workaround is to set the property to the specific value that should be inherited. Whether this is feasible depends on the context.

例如,如果您希望input元素具有与周围内容相同的字体系列,则可以使用input { font-family: inherit; },尽管这在IE7上不起作用(大问题?).但是大多数人还是想设置整个字体系列,因此您可以简单地设置例如body, input { font-family: Calibri, sans-serif; }.

For example, if you would like to have input elements have the same font family as the surrounding content, you can use input { font-family: inherit; }, though this does not work on IE7 (big issue?). But mostly people want to set the overall font family anyway, so you could simply set e.g. body, input { font-family: Calibri, sans-serif; }.

要获得更好的建议,请指定使用inherit的上下文和目的.这是很少需要的值.

To get better suggestions, please specify the context and the purpose of using inherit. It is a rarely needed value.

这篇关于字体家族是否有解决方法:IE7的继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆