CSS 初体验

BBigSun 评论51阅读模式

CSS 定义

层叠样式表(Cascading Style Sheets),是一种样式表语言,用来描述 HTML 文档的呈现。

书写位置: title 标签下方添加 style 双标签,style 中书写 CSS 代码文章源自十年又十年-https://www.bbigsun.com/882.html

<title>CSS 演示</title>
<style>
/* 选择器 */
p {
    /* CSS 属性 */
    color: red;
}
</style>

<p>
CSS xxxxx
</p>

CSS 引入方式

内部样式表:学习使用文章源自十年又十年-https://www.bbigsun.com/882.html

  • CSS 写在 style 标签中

外部样式表:开发使用文章源自十年又十年-https://www.bbigsun.com/882.html

行内样式:配合 JavaScript 使用文章源自十年又十年-https://www.bbigsun.com/882.html

<!-- 内部样式表 -->
<style>
    /* 内部样式表 */
</style>
<!-- 外部样式表 -->
<link rel="stylesheet" href="style.css">
<!-- 行内样式 -->
<div style="color:red;">这是一个红色的div</div>
文章源自十年又十年-https://www.bbigsun.com/882.html文章源自十年又十年-https://www.bbigsun.com/882.html

纸上得来终觉浅,绝知此事要躬行。

weinxin
17688689121
我的微信
微信扫一扫
BBigSun
  • 本文由 BBigSun 发表于 2024年 5月 19日 17:54:53
  • 转载请务必保留本文链接:https://www.bbigsun.com/882.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定