Text-area with em not working in IE and Opera

若如初见. 提交于 2019-12-06 05:22:06

I think the problem is caused by the changing of the font-size in #pad.

When you set a base font-size, for example 18px, then all the child elements treat 1em as 18px. However, if you change the font-size in one of the children to 1.2em then all the child elements nested within that child will start treating 1em as 22px:

body {
    font-size: 18px;
}

.parent {
    font-size: 1em;   /* 18px */
}

.child {
    font-size: 1.2em  /* 22px */
}

.child > .child {
    font-size: 1em;   /* 22px */
}

What I think is happening in Internet Explorer is that the font-size is being changed to 1.2em before the width of #pad is calculated. So the width in Firefox and Chrome is 26 * 18px where as in IE the width is 26 * 22px.

To get around this, I would set the width as a percentage instead of a fixed em measurement.

Edit

In regards the the rounded corners issue in Opera; it seems that Opera does not take kindly to the fact that neither the border-width nor border-style have been set.

Try changing border-color to border: 1px solid rgba(32, 32, 52, 0.39); and see if that resolves your issue.

for special css3 features, use vendor prefixes for each browser :
instead of border-radius:1em 1em 1em 1em; use :

-webkit-border-radius:1em;
-moz-border-radius:1em;
-o-border-radius:1em;
-ms-border-radius:1em;
border-radius:1em;
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!