一个标签中 如何引用 多个外部css

想在div标签中引用两个外部定义的css,不知代码怎么写呢?
引用一个用class=“css名”; 那引用两个要怎么写呢?帮帮忙!!急急急!!!

那引用两个要怎么写呢?

<div class=“css名1 css名2 ”></div>

注: 当然 css名1 与 css名2 有相同样式属性定义时 ,则以 css名2 里为主。

例如: css名1{font-size:12px} css名2{font-size:24px}

则 这个DIV的 字体大小 是24px
温馨提示:内容为网友见解,仅供参考
第1个回答  2015-09-10
先建个css.css文件存根目录下,内容如下:
.css {
font-family: "宋体";
font-size: 9px;
color: #000;
}

.css01 {
color: #000;
font-size:12px;
font-weight:bold;
font-family: "华文楷体";
}
a.css01:link { color: #333;text-decoration: none;}
a.css01:visited {text-decoration: none; color: #666;}
a.css01:hover { text-decoration: underline;color: #000;}
a.css01:active {text-decoration: none;color: #00397f;}

.css02 {
color: #00397f; font-weight:bold
}
a.css02:link {color: #00397f;text-decoration: none;}
a.css02:visited {text-decoration: none;color: #00397f;}
a.css02:hover {text-decoration: underline;color: #00397f;}
a.css02:active {text-decoration: none;color: #00397f;}

再在引用页内编写如下:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>css外部引用</title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>

<body class="css">
<p>默认字体</p>
<p class="css02">更改过的字体</p>
<p><a href="#" class="css01">连接1</a></p>
<p><a href="#" class="css02">连接2</a></p>
<p></p>
</body>
</html>
第2个回答  2018-03-14
<div class="css1 css2"><div>
class属性或id属性都支持这种写法,多个样式之间用空格间隔就行
第3个回答  2013-08-20
如果外部样式比较多的话!
直接用<link rel="stylesheet" type="text/css" href="css/css.css" />
如果说一个架子同时用两种或者多种不同的样式来控制!
可以参考:<div Id="mc1 mc2 mc3"></div>
第4个回答  2018-03-14

引用一个是怎么写的?

<link rel="stylesheet" href="/admin/css/xxxx.css">
<link rel="stylesheet" href="/admin/css/xxxx2.css">

不是这样吗

相似回答