浏览器何时开始每个标签支持多个类? [英] When did browsers start supporting multiple classes per tag?

查看:102
本文介绍了浏览器何时开始每个标签支持多个类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以在当前网络浏览器中的HTML标记中使用多个css类,例如:

You can use more than one css class in an HTML tag in current web browsers, e.g.:

<div class="style1 style2 style3">foo bar</div>

这并不总是奏效;

推荐答案

@Wayne Kao - IE6在阅读多个文章时没有问题类名称,以及应用属于每个类的样式。

@Wayne Kao - IE6 has no problem reading more than one class name on an element, and applying styles that belong to each class. What the article is referring to is creating new styles based on the combination of class names.

<div class="bold italic">content</div>

.bold {
  font-weight: 800;
}

.italic {
  font-style: italic;
{

IE6会对div应用粗体和斜体样式。但是,假设我们希望所有具有粗体和斜体类的元素也是紫色的。在Firefox(或者可能是IE7,不确定),我们可以这样写:

IE6 would apply both bold and italic styles to the div. However, say we wanted all elements that have bold and italic classes to also be purple. In Firefox (or possibly IE7, not sure), we could write something like this:

.bold.italic {
  color: purple;
}

这不会在IE6中工作。

That would not work in IE6.

这篇关于浏览器何时开始每个标签支持多个类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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