自定义样式表

在 Tidyverse 中用数据进行沟通

Timo Grossenbacher

Data Journalist

层叠样式表(CSS):基础选择器

<h2>摘要</h2>

<p><strong>国际劳工组织(ILO)</strong>
有许多关于工作条件的
<a href="http://test.htm">数据集
</a>。
h2 {
  font-family: "Bookman", serif;
}
body, h1, h2 {
  font-family: "Bookman", serif;
}

strong { color: "red"; }
a { color: #0000FF; font-weight: bold; }
在 Tidyverse 中用数据进行沟通

层叠样式表(CSS):类选择器

<h2>strong 元素</h2>

这里有两个带有 <strong class = "red">
加粗</strong>
<strong>的元素</strong>。
strong {
  color: "blue";
}

strong.red { color: "red"; }
在 Tidyverse 中用数据进行沟通

层叠样式表(CSS):组合器

<div>

  <p>
    这是位于段落内的
    <strong>加粗元素</strong>
  </p>
  这是另一个位于段落外的

  <strong>加粗元素</strong>。
</div>
div strong {
  color: "green";
}

div > strong { color: "red"; }

Mozilla 开发者网络 上可查找更多选择器和完整 CSS 参考。

在 Tidyverse 中用数据进行沟通

让我们来练习!

在 Tidyverse 中用数据进行沟通

Preparing Video For Download...