html - 将 CSS 规则链接到子工作表
问题描述
我希望能够在多张工作表中链接到“按钮”类的规则,并将其定义在一张工作表中,这样我只需编辑一次即可编辑我的所有按钮。
例子:
mystyle.css 内容如下:
.button{
font-family: Arial, Helvetica, sans-serif;
font-size: 30px;
height: 45px;
width: 140px;
background-color: #9999ff;
text-align: center;
padding-top: 6px;
border-radius: 25px;
}
我希望在创建新页面时能够说出类似的话
.button {
url:("../mystyle.css/.button")
}
解决方案
This one was down to me not understanding how HTML loads styles.
<html>
<head>
<link rel="stylesheet" type="text/css" href="../mystyle.css">
<link rel="stylesheet" type="text/css" href="./newpage.css">
</head>
Will load all the CSS for the buttons and then if both files define the same element, style according to newpage.css
推荐阅读
- c# - 使用 ICollectionview 在 ObservableCollection 中搜索和过滤数据
- javascript - 我需要获取数据的 URL (html)
- java - 如何使用 Java 计算每分钟完成的操作?
- android - 如何访问 Android SDK 包列表
- c# - 如何每 15 分钟预热一次电报机器人 c#?
- python - 如何从进程的内存中读取 DOUBLE
- apache-zeppelin - 使用 Jdbc 领域的 Zeppelin 身份验证
- javascript - ChartJS 动态传递数据,然后将数据传递给变量
- algorithm - Scala 可能的整数集合组合
- google-bigquery - 使用 BigQuery SQL 语法匹配记录