当前位置:   article > 正文

css新手教程

css新手教程

css新手教程

课程:14、盒子模型及边框使用_哔哩哔哩_bilibili

一.什么是CSS

1.什么是CSS

Cascading Style Sheet 层叠样式表。

CSS:表现(美化网页)

字体,颜色,边距,高度,宽度,背景图片,网页定位,网页浮动。

2.CSS发展史

  • CSS 1.0:1994年 10月提出;
  • CSS 2.0:DIV(块)+CSS,HTML与CSS结构分离的思想,网页变得简单,SEO;
  • CSS 2.1:浮动,定位;
  • CSS 3.0:圆角、阴影、动画…浏览器兼容性。

3.快速入门 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>CSS3快速入门</title>
  6. <!-- 规范:<style>可以编写CSS的代码,每一个声明最好以“;”结尾
  7. 语法:
  8. 选择器{
  9. 声明1;
  10. 声明2;
  11. 声明3;
  12. }
  13. -->
  14. <style>
  15. h1{
  16. color: blue;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <h1>CSS3测试</h1>
  22. </body>
  23. </html>

  • 建议使用这种规范(单独写一个css文件,用link标签引入css文件效果) 。

 

CSS的优势:

  • 内容和表现分离;
  • 网页结构表现统一,可以实现复用;
  • 样式十分的丰富;
  • 建议使用独立于html的css文件;
  • 利用SEO,容易被搜索引擎收录!

4.CSS的3种常用导入方式 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>CSS3快速入门</title>
  6. <!--外部样式-->
  7. <link rel="stylesheet" href="css/style.css">
  8. <style>
  9. /*内部样式*/
  10. h1{
  11. color: blue;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <!--优先级:就近原则-->
  17. <!--行内样式:在标签元素中,编写一个style属性,编写样式即可-->
  18. <h1 style="color: aquamarine">CSS3测试</h1>
  19. </body>
  20. </html>

拓展:外部样式两种方法

1.链接式——HTML 

  1. <!--外部样式-->
  2. <link rel="stylesheet" href="css/style.css">

导入式—— @import是CSS2.1特有的!

  1. <!--导入式-->
  2. <style>
  3. @import url("css/style.css");
  4. </style>

二.CSS选择器 

 1.基本选择器

 (1).标签选择器。格式:标签名{}

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>标签</title>
  6. <style>
  7. h1{
  8. color: orange;
  9. background: beige;
  10. border-radius: 10px;
  11. }
  12. h3{
  13. color: aquamarine;
  14. background: chocolate;
  15. border-radius: 10px;
  16. }
  17. p{
  18. font-size: 80px;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <h1>标签选择器</h1>
  24. <p>Android</p>
  25. <h3>前端-CSS3</h3>
  26. </body>
  27. </html>

(2).类选择器class——选择所有class一致的标签,跨标签。格式:.类名{}

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>类选择器</title>
  6. <style>
  7. /*
  8. 类选择器的格式: .class的名称{}
  9. 好处:可以多个标签归类,是同一个class,可以复用!
  10. */
  11. .test01{
  12. color: darkorange;
  13. }
  14. .test02{
  15. color: cadetblue;
  16. }
  17. .test03{
  18. color: cornflowerblue;
  19. }
  20. </style>
  21. </head>
  22. <body>
  23. <h1 class="test01">类选择器:Test01</h1>
  24. <h1 class="test02">类选择器:Test02</h1>
  25. <h1 class="test03">类选择器:Test03</h1>
  26. <p class="test03">类选择器:Test04</p>
  27. </body>
  28. </html>

(3).id选择器——全局唯一。格式:#id名{}

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. /*
  8. id选择器: id必须保证全局唯一
  9. #id名称{}
  10. 不遵循就近原则,优先级是固定的
  11. id选择器 > class类选择器 > 标签选择器
  12. */
  13. #git02{
  14. color: darkorange;
  15. }
  16. #git03{
  17. color: cadetblue;
  18. }
  19. #git01{
  20. color: cornflowerblue;
  21. }
  22. h1{
  23. color: darkseagreen;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <h1 id="git01" class="git02">id选择器:git01</h1>
  29. <h1 id="git02" class="git02">id选择器:git02</h1>
  30. <h1 class="git03">id选择器:git03</h1>
  31. <h1 id="git03" class="git01">id选择器:git01</h1>
  32. <h1>id选择器:git03</h1>
  33. </body>
  34. </html>

  • 优先级:id > class > 标签。

 2.层次选择器

 1.后代选择器:在某个元素的后面。

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. /*
  8. 后代选择器
  9. */
  10. body p{
  11. background: deeppink;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <p>p1</p>
  17. <p>p2</p>
  18. <p>p3</p>
  19. <ul>
  20. <li>
  21. <p>p4</p>
  22. </li>
  23. <li>
  24. <p>p5</p>
  25. </li>
  26. <li>
  27. <p>p6</p>
  28. </li>
  29. </ul>
  30. </body>
  31. </html>

2.子选择器:一代。

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. /*
  8. 子选择器
  9. */
  10. body>p{
  11. background: olive;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <p>p1</p>
  17. <p>p2</p>
  18. <p>p3</p>
  19. <ul>
  20. <li>
  21. <p>p4</p>
  22. </li>
  23. <li>
  24. <p>p5</p>
  25. </li>
  26. <li>
  27. <p>p6</p>
  28. </li>
  29. </ul>
  30. </body>
  31. </html>

 

3.相邻的兄弟选择器:同辈。

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. /*
  8. 相邻兄弟选择器:只选择一个,相邻向下
  9. */
  10. .active+p{
  11. background: blueviolet;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <p class="active">p1</p>
  17. <p>p2</p>
  18. <p>p3</p>
  19. <ul>
  20. <li>
  21. <p class="active">p4</p>
  22. </li>
  23. <li>
  24. <p>p5</p>
  25. </li>
  26. <li>
  27. <p>p6</p>
  28. </li>
  29. </ul>
  30. </body>
  31. </html>

4.通用兄弟选择器,当前选中元素的向下的所有兄弟元素

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. /*
  8. 通用兄弟选择器,当前选中元素的向下的所有兄弟元素
  9. */
  10. .active2~p{
  11. background: dodgerblue;
  12. }
  13. </style>
  14. </head>
  15. <body>
  16. <p class="active2">p1</p>
  17. <p>p2</p>
  18. <p>p3</p>
  19. <ul>
  20. <li>
  21. <p class="active2">p4</p>
  22. </li>
  23. <li>
  24. <p>p5</p>
  25. </li>
  26. <li>
  27. <p>p6</p>
  28. </li>
  29. </ul>
  30. </body>
  31. </html>

3.结构伪类选择器 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>伪类选择器</title>
  6. <style>
  7. ul li:first-child{
  8. /*
  9. ul的第一个子元素
  10. */
  11. background: mediumaquamarine;
  12. }
  13. ul li:last-child{
  14. /*
  15. ul的最后一个子元素
  16. */
  17. background: lightpink;
  18. }
  19. /*
  20. 选中p1:定位到<body>
  21. */
  22. p:nth-child(2){
  23. background: greenyellow;
  24. }
  25. p:nth-of-type(2){
  26. /*
  27. 选中父元素下的第二个p元素
  28. */
  29. background: lightseagreen;
  30. }
  31. a:hover{
  32. color: royalblue;
  33. }
  34. </style>
  35. </head>
  36. <body>
  37. <a href="">9521</a>
  38. <p>p1</p>
  39. <p>p2</p>
  40. <p>p3</p>
  41. <h3>h3</h3>
  42. <ul>
  43. <li>1li01</li>
  44. <li>1li02</li>
  45. <li>1li03</li>
  46. <li>1li04</li>
  47. </ul>
  48. <a href="https://www.taobao.com/">淘宝</a>
  49. </body>
  50. </html>

4.属性选择器(常用) 

  • id + class 结合
    1. <!DOCTYPE html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <title>属性选择器</title>
    6. <style>
    7. .demo a{
    8. float: left;
    9. display: block;
    10. height: 50px;
    11. width: 50px;
    12. border-radius: 10px;
    13. background: aquamarine;
    14. text-align: center;
    15. color: gray;
    16. text-decoration: none;
    17. margin-right: 5px;
    18. line-height:50px;
    19. font: bold 20px/50px Arial;
    20. }
    21. /*
    22. 属性名,属性名 = 属性值(正则)
    23. = 表示绝对等于
    24. *= 表示包含
    25. ^= 表示以...开头
    26. $= 表示以...结尾
    27. 存在id属性的元素
    28. a[]{}
    29. */
    30. a[id]{
    31. background: deeppink;
    32. }
    33. a[id=first]{
    34. /*
    35. id=first的元素
    36. */
    37. background: greenyellow;
    38. }
    39. a[class*="links"]{
    40. /*
    41. class 中有links的元素
    42. */
    43. background: green;
    44. }
    45. a[href^=http]{
    46. /*
    47. 选中href中以http开头的元素
    48. */
    49. background: yellow;
    50. }
    51. a[href$=pdf]{
    52. /*
    53. 选中href中以http开头的元素
    54. */
    55. background: red;
    56. }
    57. </style>
    58. </head>
    59. <body>
    60. <p class="demo">
    61. <a href="https://www.taobao.com/" class="links item first" id="first">淘宝</a>
    62. <a href="" class="links item active" target="_blank " title="test">链接</a>
    63. <a href="img/hello.html" class="links item">网页</a>
    64. <a href="img/str1.png" class="links item">png</a>
    65. <a href="img/str2.jpg" class="links item">jpg</a>
    66. <a href="abc" class="links item">链2</a>
    67. <a href="/fy.pdf" class="links item">pdf</a>
    68. <a href="/quit.pdf" class="links item">pdf2</a>
    69. <a href="dump.doc" class="links item">doc</a>
    70. <a href="kiko.doc" class="links item last">doc2</a>
    71. </p>
    72. </body>
    73. </html>

 三.美化网页

1.span标签

重点要突出的字,使用span标签套起来

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>美化网页</title>
  6. <style>
  7. #title{
  8. font-size: 25px;
  9. }
  10. </style>
  11. </head>
  12. <body>
  13. 编程语言:<span id="title">Java</span>
  14. </body>
  15. </html>

2.字体样式 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. /*
  8. font-family:字体
  9. font-size:字体大小 也可以填px,但不能超过900,相当于bloder
  10. font-weight:字体粗细
  11. color:字体颜色
  12. 常用写法如下:
  13. font:oblique bloder 12px "楷体"
  14. */
  15. body{
  16. font-family: "Arial Black";
  17. color: dodgerblue;
  18. }
  19. h1{
  20. font-size: 25px;
  21. }
  22. .p1{
  23. font-weight: 600;
  24. color: chocolate;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <h1>标题</h1>
  30. <p>正文6699</p>
  31. <p class="p1">正文4444444</p>
  32. <p>Study English and Computer</p>
  33. </body>
  34. </html>

3.文本样式 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. /*
  8. 一.颜色–>color:agb / rgba()
  9. 二.文本对齐方式–>text-align:center;
  10. 图片、文字水平对齐。
  11. img,span{
  12. vertical-align: middle;
  13. }
  14. 三.首行缩进–>text-indent:2em;
  15. 四.行高–>line-height:300px;
  16. 五.下划线–>text-decoration;
  17. 1.下划线:text-decoration:underline
  18. 2.中划线:text-decoration:line-through
  19. 3.上划线:text-decoration:overline
  20. 4.超链接去下划线:text-decoration:none
  21. */
  22. h1{
  23. color: rgba(0,255,255,0.9);
  24. text-align: center;
  25. }
  26. .p1{
  27. text-indent:2em;
  28. }
  29. .p3{
  30. line-height:300px;
  31. background: mediumaquamarine;
  32. height: 300px;
  33. }
  34. /*下划线*/
  35. .l1{
  36. text-decoration: underline;
  37. }
  38. /*中划线*/
  39. .l2{
  40. text-decoration: line-through;
  41. }
  42. /*上划线*/
  43. .l3{
  44. text-decoration: overline;
  45. }
  46. /*超链接去下划线*/
  47. a{
  48. text-decoration: none;
  49. }
  50. </style>
  51. </head>
  52. <body>
  53. <a href="">4399-7k7k</a>
  54. <p class="l1">123123123</p>
  55. <p class="l2">123123123</p>
  56. <p class="l3">123123123</p>
  57. <h1>概述</h1>
  58. <p class="p1">
  59. 看到有人说fcu是混凝土立方体抗压强度设计值,特来纠正一下。混凝土立方体抗压强度没有设计值,fcu是实测的混凝土立方体抗压强度,它是一个代表值。立方体抗压强度和轴心抗压强度是一组测试(3个试块为一组)的结果(一般是取其平均值。详见GBT 50081-2019 第5.0.5条);而立方体抗压标准强度是试验结果经概率统计后得到的(一般是95%的保证率)。对于同一种配比的混凝土,立方体抗压强度大于立方体抗压标准强度。即使是在土木工程这一学科中,不同的方向fcu的意义也不相同。我见到的用到fcu(或类似的如fcm等)等一般是在论文中给出材性试验数据时,一般计算用到的并不是fcu而是fcu,k以及其他的量。在混凝土规范(这里指GB 50010)里是没有fcu的,只有fcu,k
  60. </p>
  61. <p>
  62. 在1963年,我把核子的基本构成命名为“夸克”(quark),我先有的是声音,而没有拼法,所以当时也可以写成“郭克”(kwork)。不久之后,在我偶尔翻阅詹姆斯·乔伊斯所著的《芬尼根守灵夜》时,我在“向麦克老大三呼夸克”这句中看到夸克这个词。由于“夸克”(字面上意为海鸥的叫声)很明显是要跟“麦克”及其他这样的词押韵,所以我要找个借口让它读起来像“郭克”。但是书中代表的是酒馆老板伊厄威克的梦,词源多是同时有好几种。书中的词很多时候是酒馆点酒用的词。所以我认为或许“向麦克老大三呼夸克”源头可能是“敬麦克老大三个夸脱”,那么我要它读“郭克”也不是完全没根据。再怎么样,字句里的三跟自然中夸克的性质完全不谋而合。
  63. </p>
  64. <p class="p3">
  65. 茨威格则用“埃斯”(Ace)来称呼他所理论化的粒子,但是在夸克模型被广泛接纳时,盖尔曼的用词就变得很有名。很多中国物理学家则称夸克为“层子”,在台湾地区亦曾翻译“亏子”,但并不普遍使用。
  66. </p>
  67. </body>
  68. </html>

4.文本阴影和超链接伪类 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. /*超链接有默认的颜色*/
  8. a{
  9. text-decoration: hotpink;
  10. color: #000000;
  11. }
  12. /*鼠标悬浮的状态*/
  13. a:hover{
  14. color: dodgerblue;
  15. }
  16. /*鼠标按住未释放的状态*/
  17. a:active{
  18. color:green
  19. }
  20. /*点击之后的状态*/
  21. a:visited{
  22. color:mediumpurple;
  23. }
  24. /*
  25. text-shadow:5px 5px 5px 颜色
  26. 第一个参数:表示水平偏移
  27. 第二个参数:表示垂直偏移
  28. 第三个参数:表示模糊半径
  29. 第四个参数:表示颜色
  30. */
  31. #price{
  32. text-shadow: #eaff29 5px 5px 5px;
  33. }
  34. /*固定阴影*/
  35. a:link{
  36. background: bisque;
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <a href="#">
  42. <img src="tp\1.png" width="400" height="200" alt="">
  43. </a>
  44. <p>
  45. <a href="#">Java博客</a>
  46. </p>
  47. <p id="price">
  48. <a href="#">哇哈哈</a>
  49. </p>
  50. </body>
  51. </html>

5.列表ul、li 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <link href="demo.css" rel="stylesheet" type="text/css">
  7. <style>
  8. </style>
  9. </head>
  10. <body>
  11. <!--<div> 元素 (或 HTML 文档分区元素) 是一个通用型的流内容容器,
  12. 在不使用CSS的情况下,其对内容或布局没有任何影响。-->
  13. <div id="nav">
  14. <h2 class="title">全部商品分类</h2>
  15. <ul>
  16. <li>
  17. <a href="#">图书</a>
  18. <a href="#">影视</a>
  19. <a href="#">家电</a>
  20. </li>
  21. <li>
  22. <a href="#">配件</a>
  23. <a href="#">手机</a>
  24. <a href="#">数码</a>
  25. </li>
  26. <li>
  27. <a href="#">电脑</a>
  28. <a href="#">办公</a>
  29. </li>
  30. <li>
  31. <a href="#">家居</a>
  32. <a href="#">家装</a>
  33. <a href="#">厨具</a>
  34. </li>
  35. <li>
  36. <a href="#">服饰鞋帽</a>
  37. <a href="#">个性化妆</a>
  38. </li>
  39. <li>
  40. <a href="#">礼品箱包</a>
  41. <a href="#">钟表</a>
  42. <a href="#">珠宝</a>
  43. </li>
  44. <li>
  45. <a href="#">食品饮料</a>
  46. <a href="#">保健食品</a>
  47. </li>
  48. <li>
  49. <a href="#">彩票</a>
  50. <a href="#">旅行</a>
  51. <a href="#">充值</a>
  52. <a href="#">票务</a>
  53. </li>
  54. </ul>
  55. </div>
  56. </body>
  57. </html>

 

  1. #nav{
  2. width: 300px;
  3. background: beige;
  4. }
  5. .title{
  6. font-size: 18px;
  7. font-weight: bold;
  8. text-indent: 2em;/*缩进*/
  9. line-height: 35px;
  10. background: gold;
  11. }
  12. /* ul li
  13. list-style:
  14. 1.none 去掉实心圆
  15. 2.circle 空心圆
  16. 3.square 正方形
  17. */
  18. ul li{
  19. height: 30px;
  20. list-style: none;
  21. text-indent: 1em;
  22. }
  23. a{
  24. text-decoration: none;
  25. font-size: 14px;
  26. color: darkorange;
  27. }
  28. a:hover{
  29. color: dodgerblue;
  30. text-decoration: underline;
  31. }

6.背景 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>背景</title>
  6. <style>
  7. div{
  8. width: 500px;
  9. height: 200px;
  10. border: 1px solid mediumaquamarine;
  11. background-image: url("tp/1.png")
  12. /* 默认是全部平铺的 */
  13. }
  14. /*水平平铺*/
  15. .div1{
  16. background-repeat: repeat-x;
  17. }
  18. /*垂直平铺*/
  19. .div2{
  20. background-repeat: repeat-y;
  21. }
  22. /*不平铺*/
  23. .div3{
  24. background-repeat: no-repeat;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <div class="div1"></div>
  30. <div class="div2"></div>
  31. <div class="div3"></div>
  32. </body>
  33. </html>

下面的图片效果有问题 

7.渐变 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>背景</title>
  6. <style>
  7. body{
  8. background-color: #08AEEA;
  9. background-image: linear-gradient(0deg, #08AEEA 0%, #2AF598 100%);
  10. }
  11. div{
  12. width: 500px;
  13. height: 200px;
  14. border: 1px solid mediumaquamarine;
  15. background-image: url("tp/1.png")
  16. /* 默认是全部平铺的 */
  17. }
  18. /*水平平铺*/
  19. .div1{
  20. background-repeat: repeat-x;
  21. }
  22. /*垂直平铺*/
  23. .div2{
  24. background-repeat: repeat-y;
  25. }
  26. /*不平铺*/
  27. .div3{
  28. background-repeat: no-repeat;
  29. }
  30. </style>
  31. </head>
  32. <body>
  33. <div class="div1"></div>
  34. <div class="div2"></div>
  35. <div class="div3"></div>
  36. </body>
  37. </html>

四.盒子模型 

 1.什么是盒子模型

  • margin:外边距;
  • padding:内边框;
  • border:边框

2.边框 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>盒子</title>
  6. <style>
  7. /*body总有一个默认的外边距为0*/
  8. h1,ul,li,a,body{
  9. margin: 0;
  10. padding: 0;
  11. text-decoration: none;
  12. }
  13. /*border:粗细 样式 颜色*/
  14. #box{
  15. width: 300px;
  16. border: 1px solid peru;
  17. }
  18. h2{
  19. font-size: 16px;
  20. background-color: antiquewhite;
  21. line-height: 30px;
  22. margin: 0;
  23. color: hotpink;
  24. }
  25. form{
  26. background: khaki;
  27. }
  28. div:nth-of-type(1) input{
  29. border: 3px solid seagreen;
  30. }
  31. div:nth-of-type(2) input{
  32. border: 3px dashed gray;
  33. }
  34. div:nth-of-type(3) input{
  35. border: 2px solid royalblue;
  36. }
  37. </style>
  38. </head>
  39. <body>
  40. <div id="box">
  41. <h2>会员登陆</h2>
  42. <form action="#">
  43. <div>
  44. <span>用户名:</span>
  45. <input type="text">
  46. </div>
  47. <div>
  48. <span>&emsp;码:</span>
  49. <input type="text">
  50. </div>
  51. <div>
  52. <span>&emsp;箱:</span>
  53. <input type="text">
  54. </div>
  55. </form>
  56. </div>
  57. </body>
  58. </html>

3.外边距 

  1. /* 分别表示上、右、下、左;从上开始顺时针 */
  2. margin:0 0 0 0
  3. /* 例1: 居中 auto表示左右自动 */
  4. margin:0 auto
  5. /* 例2:表示上、右、下、左都为4px */
  6. margin:4px
  7. /* 例3: 表示上为10px,左右为20px,下为30px */
  8. margin:10px 20px 30px
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>外边距</title>
  6. <style>
  7. #box{
  8. width: 300px;
  9. border: 1px solid peru;
  10. margin: 0 auto;
  11. }
  12. h2{
  13. font-size: 16px;
  14. background-color: antiquewhite;
  15. line-height: 30px;
  16. margin: 0;
  17. color: hotpink;
  18. }
  19. form{
  20. background: khaki;
  21. }
  22. input{
  23. border: 1px solid tomato;
  24. }
  25. div:nth-of-type(1){
  26. padding: 10px; /* 内边距10px */
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <div id="box">
  32. <h2>会员登陆</h2>
  33. <form action="#">
  34. <div>
  35. <span>用户名:</span>
  36. <input type="text">
  37. </div>
  38. <div>
  39. <span>&emsp;码:</span>
  40. <input type="text">
  41. </div>
  42. <div>
  43. <span>&emsp;箱:</span>
  44. <input type="text">
  45. </div>
  46. </form>
  47. </div>
  48. </body>
  49. </html>

4.圆角边框

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>边框</title>
  6. <style>
  7. div{
  8. width: 100px;
  9. height: 100px;
  10. border: 10px solid mediumpurple;
  11. /* 一个border-radius只管一个圆的1/4 */
  12. border-radius: 50px 20px 20px 30px;
  13. /* 左上 右上 右下 左下 ,顺时针方向 */
  14. }
  15. img{
  16. margin: 50px;
  17. border-radius: 25px; /*圆角矩形25px*/
  18. width: 64px;
  19. height: 64px;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <div></div>
  25. <img src="tp\1.png" alt="#">
  26. </body>
  27. </html>

  

5.盒子阴影 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>边框</title>
  6. <style>
  7. img{
  8. margin: 100px;
  9. border-radius: 25px; /*圆角矩形25px*/
  10. box-shadow: 10px 10px 10px yellow;
  11. width: 64px;
  12. height: 64px;
  13. }
  14. </style>
  15. </head>
  16. <body>
  17. <div><img src="tp\1.png" alt="#"></div>
  18. </body>
  19. </html>

  

五.浮动 

1.标准文档流 

(1)块级元素:独占一行

h1~h6 、p、div、 列表…

(2)行内元素:不独占一行

spanaimgstrong

注: 行内元素可以包含在块级元素中,反之则不可以

2.dispaly 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>dispaly</title>
  6. <style>
  7. /*
  8. block: 块元素
  9. inline: 行内元素
  10. inline-block: 块元素,但是可以内联
  11. none: 隐藏
  12. */
  13. div{
  14. width: 100px;
  15. height: 100px;
  16. border: 1px solid darkorange;
  17. /* display: inline-block; */
  18. }
  19. span{
  20. width: 100px;
  21. height: 100px;
  22. border: 1px solid darkorange;
  23. /* display: inline-block; */
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div>div块元素</div>
  29. <span>span行内元素</span>
  30. </body>
  31. </html>

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>dispaly</title>
  6. <style>
  7. /*
  8. block: 块元素
  9. inline: 行内元素
  10. inline-block: 块元素,但是可以内联
  11. none: 隐藏
  12. */
  13. div{
  14. width: 100px;
  15. height: 100px;
  16. border: 1px solid darkorange;
  17. display: inline-block;
  18. }
  19. span{
  20. width: 100px;
  21. height: 100px;
  22. border: 1px solid darkorange;
  23. display: inline-block;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div>div块元素</div>
  29. <span>span行内元素</span>
  30. </body>
  31. </html>

3.float:left/right 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>浮动</title>
  6. <link href="css/style.css" rel="stylesheet" type="text/css">
  7. </head>
  8. <body>
  9. <div id="father">
  10. <div class="layer01"><img src="tp\1.png" alt=""></div>
  11. <div class="layer02"><img src="tp\屏幕截图 2024-02-01 171130.png" alt=""></div>
  12. <div class="layer03"><img src="tp\屏幕截图 2024-02-01 173553.png" alt=""></div>
  13. <div class="layer04">
  14. 浮动的盒子可以向左浮动,也可以向右浮动,知道他的外边缘碰到包含框或另一个浮动盒子为止。
  15. </div>
  16. </div>
  17. </body>
  18. </html>

  1. div{
  2. margin: 10px;
  3. padding: 5px;
  4. }
  5. #father{
  6. border: 1px #000 solid;
  7. }
  8. .layer01{
  9. border: 1px #F00 dashed;
  10. display: inline-block;
  11. float: left;
  12. }
  13. .layer02{
  14. border: 1px #00F dashed;
  15. display: inline-block;
  16. float: right;
  17. }
  18. .layer03{
  19. border: 1px #060 dashed;
  20. display: inline-block;
  21. }
  22. /*
  23. clear:
  24. right:右侧不允许有浮动元素;
  25. left:左侧不允许有浮动元素;
  26. both:两侧不允许有浮动元素;
  27. none
  28. */
  29. .layer04{
  30. border: 1px #666 dashed;
  31. font-size: 12px;
  32. line-height: 23px;
  33. display: inline-block;
  34. clear: both;
  35. }

可以看出右边的图片超出了父级边框,所有下面我们会解决这个问题 

4.父级边框塌陷的问题 

18、overflow及父级边框塌陷问题_哔哩哔哩_bilibili

  • 方案一:增加父级元素的高度;
    1. #father{
    2. border:1px #000 solid;
    3. height:800px;
    4. }

  • 方案二:增加一个空的div标签,清除浮动。
    <div class = "clear"></div>
    1. .clear{
    2. clear:both;
    3. margin:0;
    4. padding:0;
    5. }

  • 方案三:在父级元素中增加一个overflow属性。
    1. overflow:hidden; /* 隐藏超出部分 */
    2. overflow:scroll; /* 滚动 */

  • 方案四:父类添加一个伪类:after。
    1. #father:after{
    2. content:'';
    3. display:block;
    4. clear:both;
    5. }

小结:

  • 浮动元素增加空div——> 简单、代码尽量避免空div;
  • 设置父元素的高度——-> 简单,但是元素假设有了固定的高度,可能就会超出范围;
  • overflow——> 简单,下拉的一些场景避免使用;
  • 父类添加一个伪类:after(推荐)——> 写法稍微复杂,但是没有副作用,推荐使;

display与float对比:

  • display:方向不可以控制;
  • float:浮动起来的话会脱离标准文档流,所以要解决父级边框塌陷的问题。。

六.定位 

1.相对定位 

  • 相对定位:positon:relstive;
  • 相对于原来的位置,进行指定的偏移,相对定位的话,它仍然在标准文档流中!原来的位置会被保留
  1. top:-20px; /* 向上偏移20px */
  2. left:20px; /* 向右偏移20px */
  3. bottom:10px; /* 向下偏移10px */
  4. right:20px; /* 向左偏移20px */
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>练习</title>
  6. <style>
  7. #box{
  8. height: 300px;
  9. width: 300px;
  10. border: 2px red solid;
  11. padding: 10px;
  12. }
  13. a{
  14. height: 100px;
  15. width: 100px;
  16. background-color: #ee73b7;
  17. color: white;
  18. text-align: center;
  19. text-decoration: none;
  20. line-height: 100px; /* 设置行距100px */
  21. display: block; /* 设置方块 */
  22. }
  23. a:hover{
  24. background: #4158D0;
  25. }
  26. .a2,.a4{
  27. position: relative;
  28. left: 200px;
  29. top: -100px;
  30. }
  31. .a5{
  32. position: relative;
  33. left: 100px;
  34. top: -300px;
  35. }
  36. </style>
  37. </head>
  38. <body>
  39. <div id="box">
  40. <div class="a1"><a href="#">连接1</a></div>
  41. <div class="a2"><a href="#">连接2</a></div>
  42. <div class="a3"><a href="#">连接3</a></div>
  43. <div class="a4"><a href="#">连接4</a></div>
  44. <div class="a5"><a href="#">连接5</a></div>
  45. </div>
  46. </body>
  47. </html>

2.绝对定位

  • 定位:基于xxx定位,上下左右;
    1. 没有父级元素定位的前提下,相对于浏览器定位;
    2. 假设父级元素存在定位,我们通常会相对于父级元素进行偏移;
    3. 在父级元素范围内移动。

总结:相对一父级或浏览器的位置,进行指定的偏移,绝对定位的话,它不在标准文档流中,原来的位置不会被保留。

3.固定定位 

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>绝对定位</title>
  6. <style>
  7. body{
  8. height: 1000px;
  9. }
  10. div:nth-of-type(1){
  11. width: 100px;
  12. height: 60px;
  13. background-color: #4a77d4;
  14. position: absolute; /* absolute 绝对定位 */
  15. right: 0;
  16. bottom: 0;
  17. }
  18. div:nth-of-type(2){
  19. width: 40px;
  20. height: 40px;
  21. background-color: #fcb346;
  22. position: fixed; /* fixed 固定定位 */
  23. right: 0;
  24. bottom: 0;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <div>div1</div>
  30. <div>div2</div>
  31. </body>
  32. </html>

 4.z-index及透明度

  • 图层-z-index:默认是0,最高无限~999。
    1. <!DOCTYPE html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <title>透明度</title>
    6. <link rel="stylesheet" href="demo.css" type="text/css">
    7. <style>
    8. </style>
    9. </head>
    10. <body>
    11. <div id="content">
    12. <ul>
    13. <li><img src="tp\1.png" alt=""></li>
    14. <li class="tipText">Java后端学习</li>
    15. <li class="tipBg"></li>
    16. <li>时间:1202-06-15</li>
    17. <li>地点:水星基地核心仓</li>
    18. </ul>
    19. </div>
    20. </body>
    21. </html>
    1. #content{
    2. width: 450px;
    3. padding: 0px;
    4. margin: 0px;
    5. overflow: hidden;
    6. font-size: 12px;
    7. line-height: 25px;
    8. border: 1px solid #1079f6;
    9. }
    10. ul,li{
    11. padding: 0px;
    12. margin: 0px;
    13. list-style: none;
    14. }
    15. /* 父级元素相对定位 */
    16. #content ul{
    17. position: relative;
    18. }
    19. .tipText,.tipBg{
    20. position: absolute;
    21. width: 380px;
    22. height: 25px;
    23. top:216px
    24. }
    25. .tipText{
    26. color: #ffffff;
    27. z-index: 999;
    28. }
    29. .tipBg{
    30. background: #33f13d;
    31. opacity: 0.5; /* 背景透明度 */
    32. filter: alpha(opacity=50);
    33. }

 七.网页动画

CSS3 动画 | 菜鸟教程 (runoob.com)

  1. <!doctype html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>HTML5 Canvas模拟飞机航班线路动画DEMO演示</title>
  6. <style>
  7. *{margin:0;padding:0;}
  8. canvas {
  9. background:#111;
  10. background-size:cover;
  11. display:block;
  12. }
  13. body{overflow: hidden;}
  14. </style>
  15. </head>
  16. <body>
  17. <div></div>
  18. <script>
  19. window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)} }();
  20. $ = {};
  21. $.util = {
  22. rand: function( min, max ) {
  23. return Math.random() * ( max - min ) + min;
  24. },
  25. randInt: function( min, max ) {
  26. return Math.floor( Math.random() * ( max - min + 1 ) ) + min;
  27. },
  28. norm: function( val, min, max ) {
  29. return ( val - min ) / ( max - min );
  30. },
  31. lerp: function( norm, min, max ) {
  32. return ( max - min ) * norm + min;
  33. },
  34. map: function( val, sMin, sMax, dMin, dMax ) {
  35. return $.util.lerp( $.util.norm( val, sMin, sMax), dMin, dMax );
  36. },
  37. clamp: function( val, min, max ) {
  38. return Math.min( Math.max( val, Math.min( min, max ) ), Math.max( min, max ) );
  39. },
  40. distance: function( p1, p2 ) {
  41. var dx = p1.x - p2.x,
  42. dy = p1.y - p2.y;
  43. return Math.sqrt( dx * dx + dy * dy );
  44. },
  45. angle: function( p1, p2 ) {
  46. return Math.atan2( p1.y - p2.y, p1.x - p2.x );
  47. },
  48. inRange: function( val, min, max ) {
  49. return val >= Math.min( min, max ) && val <= Math.max( min, max );
  50. },
  51. pointInRect: function( x, y, rect ) {
  52. return $.util.inRange( x, rect.x, rect.x + rect.width ) &&
  53. $.util.inRange( y, rect.y, rect.y + rect.height );
  54. },
  55. pointInArc: function( p, a ) {
  56. return distance( p, a ) <= a.radius;
  57. },
  58. setProps: function( obj, props ) {
  59. for( var k in props ) {
  60. obj[ k ] = props[ k ];
  61. }
  62. },
  63. multicurve: function( points, ctx ) {
  64. var p0, p1, midx, midy;
  65. ctx.moveTo(points[0].x, points[0].y);
  66. for(var i = 1; i < points.length - 2; i += 1) {
  67. p0 = points[i];
  68. p1 = points[i + 1];
  69. midx = (p0.x + p1.x) / 2;
  70. midy = (p0.y + p1.y) / 2;
  71. ctx.quadraticCurveTo(p0.x, p0.y, midx, midy);
  72. }
  73. p0 = points[points.length - 2];
  74. p1 = points[points.length - 1];
  75. ctx.quadraticCurveTo(p0.x, p0.y, p1.x, p1.y);
  76. }
  77. };
  78. $.init = function() {
  79. // setup
  80. $.c = document.createElement( 'canvas' );
  81. $.ctx = $.c.getContext( '2d' );
  82. document.body.appendChild( $.c );
  83. // collections
  84. $.ports = [];
  85. $.planes = [];
  86. // events
  87. window.addEventListener( 'resize', $.reset, false );
  88. window.addEventListener( 'click', $.reset, false );
  89. $.reset();
  90. $.step();
  91. };
  92. $.reset = function() {
  93. // dimensions
  94. $.cw = $.c.width = window.innerWidth;
  95. $.ch = $.c.height = window.innerHeight;
  96. $.dimAvg = ( $.cw + $.ch ) / 2;
  97. // type / font
  98. $.ctx.textAlign = 'center';
  99. $.ctx.textBaseline = 'middle';
  100. $.ctx.font = '16px monospace';
  101. // options / settings
  102. $.opt = {};
  103. $.opt.portCount = 6;
  104. $.opt.planeCount = 80;
  105. $.opt.portSpacingDist = $.dimAvg / $.opt.portCount;
  106. $.opt.holdingDist = 5;
  107. $.opt.approachDist = 80;
  108. $.opt.planeDist = 20;
  109. $.opt.pathSpacing = 15;
  110. $.opt.pathCount = 40;
  111. $.opt.avoidRadius = 30;
  112. $.opt.avoidMult = 0.025;
  113. // collections
  114. $.ports.length = 0;
  115. $.planes.length = 0;
  116. // delta
  117. $.lt = Date.now();
  118. $.dt = 1;
  119. $.et = 0;
  120. $.tick = 0;
  121. // setup ports
  122. for( var i = 0; i < $.opt.portCount; i++ ) {
  123. $.ports.push( new $.Port() );
  124. }
  125. // setup planes
  126. for( var i = 0; i < $.opt.planeCount; i++ ) {
  127. $.planes.push( new $.Plane() );
  128. }
  129. };
  130. $.Port = function() {
  131. this.x = $.util.rand( $.cw * 0.1, $.cw * 0.9 );
  132. this.y = $.util.rand( $.ch * 0.1, $.ch * 0.9 );
  133. while( !this.validSpacing() ) {
  134. this.x = $.util.rand( $.cw * 0.1, $.cw * 0.9 );
  135. this.y = $.util.rand( $.ch * 0.1, $.ch * 0.9 );
  136. }
  137. };
  138. $.Port.prototype.validSpacing = function() {
  139. var spaced = true,
  140. i = $.ports.length;
  141. while( i-- ) {
  142. var otherPort = $.ports[ i ];
  143. if( $.util.distance( otherPort, this ) < $.opt.portSpacingDist ) {
  144. spaced = false;
  145. break;
  146. }
  147. }
  148. return spaced;
  149. };
  150. $.Port.prototype.update = function( i ) {
  151. var j = $.planes.length;
  152. this.approachingCount = 0;
  153. while( j-- ) {
  154. var plane = $.planes[ j ];
  155. if( plane.destIndex == i && plane.approaching ) {
  156. this.approachingCount++;
  157. }
  158. }
  159. };
  160. $.Port.prototype.render = function( i ) {
  161. $.ctx.beginPath();
  162. $.ctx.arc( this.x, this.y, 3 + ( this.approachingCount + 5 ), 0, Math.PI * 2 );
  163. $.ctx.fillStyle = 'hsla(120, 90%, 80%, ' + ( 0.35 + Math.sin( $.et / 20 ) * 0.2 ) + ')';
  164. $.ctx.fill();
  165. $.ctx.fillStyle = '#fff';
  166. $.ctx.fillText( this.approachingCount, this.x, this.y - 30 );
  167. };
  168. $.Plane = function( opt ) {
  169. this.originIndex = $.util.randInt( 0, $.ports.length - 1 );
  170. this.origin = $.ports[ this.originIndex ];
  171. this.path = [];
  172. this.x = this.origin.x;
  173. this.y = this.origin.y;
  174. this.vx = $.util.rand( -0.35, 0.35 );
  175. this.vy = $.util.rand( -0.35, 0.35 );
  176. this.vmax = 1;
  177. this.accel = 0.01;
  178. this.decel = 0.96;
  179. this.angle = 0;
  180. this.approaching = false;
  181. this.holding = false;
  182. this.setDest();
  183. };
  184. $.Plane.prototype.setDest = function() {
  185. if( this.destIndex != undefined ) {
  186. this.originIndex = this.destIndex;
  187. this.origin = $.ports[ this.originIndex ];
  188. }
  189. this.destIndex = $.util.randInt( 0, $.ports.length - 1 );
  190. while( this.destIndex == this.originIndex ) {
  191. this.destIndex = $.util.randInt( 0, $.ports.length - 1 );
  192. }
  193. this.dest = $.ports[ this.destIndex ];
  194. this.approaching = false;
  195. this.holding = false;
  196. }
  197. $.Plane.prototype.update = function( i ) {
  198. this.ox = this.x;
  199. this.oy = this.y;
  200. if( $.tick % $.opt.pathSpacing == 0 ) {
  201. this.path.push( { x: this.x, y: this.y } );
  202. }
  203. if( this.path.length > $.opt.pathCount ) {
  204. this.path.shift();
  205. }
  206. this.angle = $.util.angle( this.dest, this );
  207. this.speed = ( Math.abs( this.vx ) + Math.abs( this.vy ) ) / 2;
  208. if( !$.util.pointInRect( this.x, this.y, { x: 0, y: 0, width: $.cw, height: $.ch } ) ) {
  209. this.vx *= this.decel;
  210. this.vy *= this.decel;
  211. }
  212. if( this.speed > 0.1 ) {
  213. if( $.util.distance( this.dest, this ) < $.opt.approachDist ) {
  214. this.vx *= this.decel;
  215. this.vy *= this.decel;
  216. this.approaching = true;
  217. }
  218. }
  219. if( $.util.distance( this.dest, this ) < $.opt.holdingDist ) {
  220. this.holding = true;
  221. this.setDest();
  222. }
  223. this.vx += Math.cos( this.angle ) * this.accel;
  224. this.vy += Math.sin( this.angle ) * this.accel;
  225. if( this.speed > this.vmax ) {
  226. this.vx *= this.decel;
  227. this.vy *= this.decel;
  228. }
  229. this.x += this.vx * $.dt;
  230. this.y += this.vy * $.dt;
  231. };
  232. $.Plane.prototype.render = function( i ) {
  233. if( this.approaching ) {
  234. $.ctx.strokeStyle = 'hsla(0, 80%, 50%, 1)';
  235. } else {
  236. $.ctx.strokeStyle = 'hsla(180, 80%, 50%, 1)';
  237. }
  238. $.ctx.beginPath();
  239. $.ctx.moveTo( this.x, this.y );
  240. var angle = $.util.angle( { x: this.ox, y: this.oy }, this );
  241. $.ctx.lineWidth = 2;
  242. $.ctx.lineTo(
  243. this.x - Math.cos( angle ) * ( 3 + this.speed * 2 ),
  244. this.y - Math.sin( angle ) * ( 3 + this.speed * 2 )
  245. );
  246. $.ctx.stroke();
  247. var pathLength = this.path.length;
  248. if( pathLength > 1) {
  249. $.ctx.strokeStyle = 'hsla(0, 0%, 100%, 0.15)';
  250. $.ctx.lineWidth = 1;
  251. $.ctx.beginPath();
  252. if( pathLength >= $.opt.pathCount ) {
  253. var angle = $.util.angle( this.path[ 1 ], this.path[ 0 ] ),
  254. dx = this.path[ 0 ].x - this.path[ 1 ].x,
  255. dy = this.path[ 0 ].y - this.path[ 1 ].y,
  256. dist = Math.sqrt( dx * dx + dy * dy ),
  257. x = this.path[ 0 ].x + Math.cos( angle ) * ( dist * ( ( $.tick % $.opt.pathSpacing ) / $.opt.pathSpacing ) ),
  258. y = this.path[ 0 ].y + Math.sin( angle ) * ( dist * ( ( $.tick % $.opt.pathSpacing ) / $.opt.pathSpacing ) );
  259. } else {
  260. var x = this.path[ 0 ].x,
  261. y = this.path[ 0 ].y
  262. }
  263. $.ctx.moveTo( x, y );
  264. for( var i = 1; i < pathLength; i++ ) {
  265. var point = this.path[ i ];
  266. $.ctx.lineTo( point.x, point.y );
  267. }
  268. $.ctx.lineTo( this.x, this.y );
  269. $.ctx.stroke();
  270. }
  271. };
  272. $.step = function() {
  273. requestAnimFrame( $.step );
  274. // clear
  275. $.ctx.globalCompositeOperation = 'destination-out';
  276. $.ctx.fillStyle = 'hsla(0, 0%, 0%, 1)';
  277. $.ctx.fillRect( 0, 0, $.cw, $.ch );
  278. $.ctx.globalCompositeOperation = 'lighter';
  279. // collections
  280. var i;
  281. i = $.ports.length; while( i-- ) { $.ports[ i ].update( i ) }
  282. i = $.planes.length; while( i-- ) { $.planes[ i ].update( i ) }
  283. i = $.ports.length; while( i-- ) { $.ports[ i ].render( i ) }
  284. i = $.planes.length; while( i-- ) { $.planes[ i ].render( i ) }
  285. // delta
  286. var now = Date.now();
  287. $.dt = $.util.clamp( ( now - $.lt ) / ( 1000 / 60 ), 0.001, 10 );
  288. $.lt = now;
  289. $.et += $.dt;
  290. $.tick++;
  291. };
  292. $.init();
  293. </script>
  294. </body>
  295. </html>

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/blog/article/detail/60383
推荐阅读
相关标签
  

闽ICP备14008679号