CSS样式


参考网站:

CSS用法:3种

一:直接样式表 如<p style="color:red;">这是一个段落</p>

二:内部样式表 如:<style>p{color:red;}</style>

三:外部样式表 如:<link rel="stylesheet" href="外部css样式的路径名称" type="text/css"/>

 

样式表表示法:

1.段落等标签直接在<style>p{color:red;}</style>里使用

2.ID选择器:可以对指定的ID进行应用样式 如<style>#p{color:red;}</style>对body里的应用字体为红色

3.类选择器:可以应用于多个同一样样式 如 <style>.tt{color:red;}</style> 对body所有class="tt"的应用字体为红色

嵌套使用

4.<style>.tt,.aa{color:red;}</style>    对class="aa"或class="tt"的设置字体为红色

5.<style>p .aa{color:red;}</style>      查找段落P下的class="aa"的并设置字体为红色

6.<style>p.aa{color:red;}</style>       查找class="aa"的段落P并设置字体为红色

 

多使用css帮助文档

 宽度 wight 高度 height  100%  字体  大小: text-size:14px 字体颜色:text-font:red; 字体类型:text-family:"微软雅黑"

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-22
  • 2022-12-23
  • 2021-07-31
  • 2021-09-17
猜你喜欢
  • 2022-12-23
  • 2021-08-18
  • 2021-12-22
  • 2021-10-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案