有什么方法可以消除斜体效果吗?使用CSS标记? [英] Is there any way to remove italic effect <i> tag using CSS?

查看:114
本文介绍了有什么方法可以消除斜体效果吗?使用CSS标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何删除< i> 标记的斜体效果,所以我可以这样做:

How do I remove italic effect of <i> tag so I can do this:

<span>
    test<i>test</i>
</span>

我正在< i> 标签使用jQuery innerHtml,所以它以斜体显示,但我不希望使用斜体效果。

I am filling some text in the <i> tag using jQuery innerHtml, so it comes in italic, but I don't want the italic effect.

有什么方法可以使用CSS删除斜体效果吗?

Is there any way I can remove the italic effect using CSS?

我不能使用其他标签。我只能使用< i> 标记。

I cant use a different tag. I can only use the <i> tag.

推荐答案

您只需使用以下CSS代码即可:

You just need to use this CSS code:

.no-italics {
    font-style: normal;   
}

HTML代码:

<span>
   test
   <i class='no-italics'>test</i>
</span>

这篇关于有什么方法可以消除斜体效果吗?使用CSS标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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