元素选择器
最常见的 CSS 选择器是元素选择器。换句话说,文档的元素就是最基本的选择器。
如果设置 HTML 的样式,选择器通常将是某个 HTML 元素,比如 p、h1、em、a,甚至可以是 html 本身:
设置html黑色,h1蓝色,h2银色
html { color:black;}h1 { color:blue;}h2 { color:silver;}
CSS Test Website This heading 1
This heading 2
This is a normal paragraph.
测试
尝试将html设置为red之后:html仅仅针对文本,无法对title起作用
取消h1的蓝色,设置paragraph为蓝色
html { color:black;}p { color:blue;}h2 { color:silver;}
xml文档设置样式
默认的显示
George John Reminder Don't forget the meeting!
显示效果
设置css样式,并且在xml中引用样式文件
在xml中引用样式文件的时候,先输入<,然后输入? ,webstorm会自动进行补全
引用方式是
另外,关于xml中标签自定义的说明,可以查看
通过 XML 您可以发明自己的标签
最后,相关文件已经上传到github