• 【html-CSS布局】简单设计一个静态网页


    html常用的标签属性:

    * 注释:
            *

    to

    :标题标签
                * h1~h6:字体大小逐渐递减
            *

    :段落标签
            *
    :换行标签
            *


    :展示一条水平线
                * 属性:
                    * color:颜色
                    * width:宽度
                    * size:高度
                    * align:对其方式
                        * center:居中
                        * left:左对齐
                        * right:右对齐
            * :字体加粗
            * :字体斜体
            * :字体标签
            *
    :文本居中
                * 属性:
                    * color:颜色
                    * size:大小
                    * face:字体

            * 属性定义:
                * color:
                    1. 英文单词:red,green,blue
                    2. rgb(值1,值2,值3):值的范围:0~255  如  rgb(0,0,255)
                    3. #值1值2值3:值的范围:00~FF之间。如: #FF00FF
                * width:
                    1. 数值:width='20' ,数值的单位,默认是 px(像素)
                    2. 数值%:占比相对于父元素的比例

    超链接:

    * a:定义一个超链接
                * 属性:
                    * href:指定访问资源的URL(统一资源定位符)
                    * target:指定打开资源的方式
                        * _self:默认值,在当前页面打开
                        * _blank:在空白页面打开

    文字

    表格标签:


            * table:定义表格
                * width:宽度
                * border:边框
                * cellpadding:定义内容和单元格的距离
                * cellspacing:定义单元格之间的距离。如果指定为0,则单元格的线会合为一条、
                * bgcolor:背景色
                * align:对齐方式
            * tr:定义行
                * bgcolor:背景色
                * align:对齐方式
            * td:定义单元格
                * colspan:合并列
                * rowspan:合并行
            * th:定义表头单元格
            * :表格标题
            * :表示表格的头部分
            * :表示表格的体部分
            * :表示表格的脚部分

    实战练习:

    1. html>
    2. <html lang="en">
    3. <head>
    4. <meta charset="UTF-8">
    5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
    6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
    7. <title>魈魈快乐窝title>
    8. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/css/bootstrap.min.css" integrity="sha384-zCbKRCUGaJDkqS1kPbPd7TveP5iyJE0EjAuZQTgFLD2ylzuqKfdKlfG/eSrtxUkn" crossorigin="anonymous">
    9. <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous">script>
    10. <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.1/dist/js/bootstrap.bundle.min.js" integrity="sha384-fQybjgWLrvvRgtW6bFlB7jaZrFsaBXjsOMm/tB9LTS58ONXgqbR9W8oWht/amnpF" crossorigin="anonymous">script>
    11. <link rel="stylesheet" href="./style001.css">
    12. head>
    13. <body>
    14. <div class="gongjvlan">
    15. <span class="gongjvlan">                            span>
    16. <span class="gongjvlan">所属国家-璃月span>
    17. <span class="gongjvlan">种族span>
    18. <span class="gongjvlan">span>
    19. <span class="gongjvlan">span>
    20. <span class="gongjvlan">span>
    21. <span class="gongjvlan">span>
    22. <span class="gongjvlan">,span>
    23. <span class="gongjvlan">     span>
    24. <span class="gongjvlan">span>
    25. <span class="gongjvlan">span>
    26. <span class="gongjvlan">span>
    27. <span class="gongjvlan">span>
    28. <span class="gongjvlan">span>
    29. <span class="gongjvlan">span>
    30. <span class="gongjvlan">span>
    31. <span class="gongjvlan">span>
    32. <span class="gongjvlan">span>
    33. <span class="gongjvlan">span>
    34. <span class="gongjvlan">阵。span>
    35. <img src="折扇.png" style="width: 30px; height: 20px;text-align: center;position: relative;top: 5px;">
    36. div>
    37. <div class="head">
    38. <a href="http://localhost:63342/javaWeb001/%E6%B3%A8%E5%86%8C.html?_ijt=bd71lntimccg70qqm5ninu95lt"><img src="三足鼎.png" style="width: 50px; height: 50px;text-align: center;position: relative;left: 110px;top: 15px;">a>
    39. <span class="head" style="position: absolute;left: 400px;line-height: 100px;">少年英雄    夜叉仙众    且听风吟    傩戏文化    人设生平        span>
    40. <span><form action="" style="position: absolute;right: 100px;">
    41. <input type="text" placeholder="请输入搜索内容" h><img src="搜索.png" style="width: 30px;height: 20px;text-align: center;position: relative;right: -2px;top: -2px;">form>span>
    42. div>
    43. <div class="paimian">
    44. <div class="zhuti" style="display: inline-block;">
    45. <div class="xx"><img src=" 箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px; ">div>
    46. <div class="xx "><img src="箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px; ">div>
    47. <div class="xx"><img src=" 箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px;">div>
    48. <div class="xx"><img src=" 箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px; ">div>
    49. <div class="xx "><img src="箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px;">div>
    50. <div class="xx"><img src=" 箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px;">div>
    51. <div class="xx "><img src="箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px;">div>
    52. <div class="xx"><img src=" 箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px;">div>
    53. <div class="xx"><img src=" 箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px;">div>
    54. <div class="xx"><img src=" 箭头1.png " style="width: 25px; height: 25px;position:relative;left: 60px;">div>
    55. div>
    56. <span class="slide" style="display: inline-block;">
    57. <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
    58. <ol class="carousel-indicators">
    59. <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active">li>
    60. <li data-target="#carouselExampleIndicators" data-slide-to="1">li>
    61. <li data-target="#carouselExampleIndicators" data-slide-to="2">li>
    62. ol>
    63. <div class="carousel-inner">
    64. <div class="carousel-item active">
    65. <img src="111.png" class="d-block w-100" alt="..." >
    66. div>
    67. <div class="carousel-item">
    68. <img src="1657612800381.jpeg" class="d-block w-100" alt="..." >
    69. div>
    70. <div class="carousel-item">
    71. <img src="2643CAB1AB3F92913F54237612049B3D27672313.jpg" class="d-block w-100" alt="...">
    72. div>
    73. div>
    74. <button class="carousel-control-prev" type="button" data-target="#carouselExampleIndicators" data-slide="prev">
    75. <span class="carousel-control-prev-icon" aria-hidden="true">span>
    76. <span class="sr-only">Previousspan>
    77. button>
    78. <button class="carousel-control-next" type="button" data-target="#carouselExampleIndicators" data-slide="next">
    79. <span class="carousel-control-next-icon" aria-hidden="true">span>
    80. <span class="sr-only">Nextspan>
    81. button>
    82. div>
    83. span>
    84. div>
    85. div>
    86. <div class="diyikuan ">
    87. <div class="yy">
    88. <div class="diyi ">
    89. <img src="青龙偃月刀.png " style="width: 50px; height: 50px; ">
    90. <div>div>
    91. div>
    92. <div class="diyi "><img src="青龙偃月刀.png " style="width: 50px; height: 50px; ">
    93. <div>div>
    94. div>
    95. <div class="diyi "><img src="青龙偃月刀.png " style="width: 50px; height: 50px; ">
    96. <div>div>
    97. div>
    98. <div class="diyi "><img src="方孔钱.png " style="width: 50px; height: 50px; ">
    99. <div>div>
    100. div>
    101. <div class="diyi "><img src="方孔钱.png" style="width: 50px; height: 50px; ">
    102. <div>div>
    103. div>
    104. <div class="diyi "><img src="方孔钱.png " style="width: 50px; height: 50px; ">
    105. <div>div>
    106. div>
    107. <div class="diyi "><img src="三足鼎.png " style="width: 50px; height: 50px; ">
    108. <div>div>
    109. div>
    110. <div class="diyi "><img src="三足鼎.png " style="width: 50px; height: 50px; ">
    111. <div>div>
    112. div>
    113. <div class="diyi "><img src="三足鼎.png " style="width: 50px; height: 50px; ">
    114. <div>div>
    115. div>
    116. div>
    117. <div class="jj2">
    118. <img src="1.jpg " width="425px" height="200px">
    119. <img src="2.jpg " width="425px" height="200px">
    120. <img src="3.jpeg " width="425px" height="200px">
    121. div>
    122. div>
    123. <div class="zhongxin ">
    124. <div class="ww "><img src="折扇.png " style="width: 60px; height: 60px; ">
    125. div>
    126. <div class="ww "><img src="竹子.png " style="width: 60px; height: 60px; ">
    127. div>
    128. <div class="ww "><img src="古风物件,中国风,中国结.png " style="width: 60px; height: 60px; ">
    129. div>
    130. <div class="ww "><img src="古风伞.png " style="width: 60px; height: 60px; ">
    131. div>
    132. <div class="ww "><img src="竹简.png " style="width: 60px; height: 60px; ">
    133. div>
    134. div>
    135. <div class="jj1">
    136. <img src="1.jpg" style="width: 100px; height: 72px;text-align: center;position: absolute;left: 10px;top: 5px; ">
    137. <img src="2.jpg" style="width: 100px; height: 72px;text-align: center;position: absolute;left: 200px;top: 5px; ">
    138. <img src="3.jpeg" style="width:100px; height: 72px;text-align: center;position: absolute;left: 390px;top: 5px; ">
    139. <img src="4.jpeg" style="width: 100px; height: 72px;text-align: center;position: absolute;left: 580px;top: 5px; ">
    140. <p>
    141. <img src="5.jpeg" style="width: 100px; height: 72px;text-align: center;position: absolute;left: 10px;top: 80px; ">
    142. <img src="6.jpeg" style="width: 100px; height: 72px;text-align: center;position: absolute;left: 200px;top: 80px; ">
    143. <img src="魈哥.jpg" style="width: 100px; height: 72px;text-align: center;position: absolute;left: 390px;top: 80px; ">
    144. <img src="8.jpg" style="width: 100px; height: 72px;text-align: center;position: absolute;left: 580px;top: 80px; ">
    145. p>
    146. div>
    147. <div class="zhongxin1">
    148. <div class="ww "><img src="方天画戟.png " style="width: 60px; height: 60px; ">
    149. div>
    150. <div class="ww "><img src="鼓.png " style="width: 60px; height: 60px; ">
    151. div>
    152. <div class="ww "><img src="中国风,埙.png " style="width: 60px; height: 60px; ">
    153. div>
    154. <div class="ww "><img src="方天画戟.png " style="width: 60px; height: 60px; ">
    155. div>
    156. <div class="ww "><img src="琵琶-01.png " style="width: 100px; height: 100px; ">
    157. div>
    158. div>
    159. body>
    160. html>
    1. #carouselExampleIndicators {
    2. width: 1000px;
    3. height: 900px;
    4. float: left;
    5. position: absolute;
    6. left: 337px;
    7. top: 130px;
    8. }
    9. .gongjvlan {
    10. width: 1500px;
    11. height: 30px;
    12. background: #05414f;
    13. border: 1px solid #05414f;
    14. line-height: 30px;
    15. text-align: left;
    16. font-size: 13px;
    17. color: antiquewhite;
    18. overflow: hidden;
    19. }
    20. .head {
    21. width: 1500px;
    22. height: 100px;
    23. float: left;
    24. background: antiquewhite;
    25. }
    26. .head1 {
    27. width: 30px;
    28. height: 20px;
    29. text-align: center;
    30. position: relative;
    31. right: -2px;
    32. top: -2px;
    33. }
    34. .head1:hover {
    35. opacity: 1;
    36. }
    37. .zhuti {
    38. width: 200px;
    39. height: 700px;
    40. background: #044758;
    41. border: 10px solid #044758;
    42. text-align: center;
    43. font-size: 15px;
    44. color: lightgoldenrodyellow;
    45. float: left;
    46. position: relative;
    47. left: 110px;
    48. }
    49. .paimian {
    50. width: 1500px;
    51. height: 700px;
    52. float: left;
    53. }
    54. .diyikuan {
    55. width: 1500px;
    56. height: 200px;
    57. float: left;
    58. position: absolute;
    59. left: 110px;
    60. top: 880px;
    61. border: 1px solid bisque;
    62. }
    63. .yy {
    64. width: 210px;
    65. height: 200px;
    66. float: left;
    67. background-color: cadetblue;
    68. }
    69. .jj {
    70. width: 1000px;
    71. height: 200px;
    72. opacity: 1;
    73. position: absolute;
    74. left: 337px;
    75. top: 148px;
    76. }
    77. .jj1 {
    78. width: 1028px;
    79. height: 200px;
    80. position: absolute;
    81. left: 190px;
    82. top: -750px;
    83. background: #faf7f1;
    84. opacity: 0;
    85. }
    86. .jj2 {
    87. width: 1290px;
    88. height: 200px;
    89. position: absolute;
    90. left: 220px;
    91. background: #faf7f1;
    92. opacity: 1;
    93. }
    94. .diyikuan.jj2 img{
    95. width: 100%;
    96. height: 100%;
    97. position: static;
    98. }
    99. .jj1:hover {
    100. opacity: 1;
    101. }
    102. .diyi {
    103. width: 70px;
    104. height: 70px;
    105. float: left;
    106. text-align: center;
    107. font-size: 10px;
    108. color: lightgoldenrodyellow;
    109. }
    110. .zhongxin {
    111. width: 100px;
    112. height: 500px;
    113. float: right;
    114. border: 5px solid rgb(233, 232, 232);
    115. position: fixed;
    116. right: 50px;
    117. top: 200px;
    118. text-align: end;
    119. background: rgb(233, 232, 232);
    120. }
    121. .zhongxin1 {
    122. width: 100px;
    123. height: 500px;
    124. float: right;
    125. border: 5px solid rgb(233, 232, 232);
    126. position: fixed;
    127. right: 50px;
    128. top: 200px;
    129. text-align: end;
    130. background: rgb(233, 232, 232);
    131. opacity: 0;
    132. color: seagreen;
    133. }
    134. .zhongxin1:hover {
    135. opacity: 1;
    136. }
    137. .ww {
    138. width: 100px;
    139. height: 100px;
    140. float: right;
    141. text-align: center;
    142. }
    143. .xx {
    144. width: 160px;
    145. height: 70px;
    146. float: left;
    147. text-align: left;
    148. color: white;
    149. font-size: 20px;
    150. position: relative;
    151. left: 10px;
    152. border: 0px solid rgb(161, 159, 159);
    153. line-height: 70px;
    154. }
    155. .slide {
    156. width: 800px;
    157. height: 800px;
    158. }
    159. .carousel-inner{
    160. width: 1350px;
    161. height: 700px;
    162. right: 15px;
    163. }
    164. .carousel-inner .carousel-item{
    165. width: 100%;
    166. height: 100%;
    167. }
    168. .carousel-inner .carousel-item img{
    169. width: 100%;
    170. height: 100%;
    171. margin-top: 10px;
    172. }

  • 相关阅读:
    选择排序(C++实现)
    c语言数据结构 二叉树(二)
    飞腾性能调优
    centos7搭建maven私服nexus
    彻底搞通服务发现的原理和实现
    docker容器服务器编排利器 Docker Compose应用实战
    LeetCode每日一题(963. Minimum Area Rectangle II)
    python牛客网刷题查漏补缺1
    分页查询和聚合查询
    [附源码]SSM计算机毕业设计餐厅卫生安全系统JAVA
  • 原文地址:https://blog.csdn.net/akisi/article/details/125902478