image.png

    1. <!DOCTYPE html>
    2. <html>
    3. <head>
    4. <meta charset="utf-8">
    5. <title></title>
    6. <style>
    7. .top{
    8. width: 100%;
    9. height: 100px;
    10. border:1px solid red ;
    11. }
    12. .top_a{
    13. color: gray;
    14. font-size: 12px;
    15. /* 字体加粗 */
    16. font-weight: bold;
    17. /* 字体风格 */
    18. font-family: 宋体;
    19. /* 字体倾斜 */
    20. font-style: italic;
    21. /* 去除下滑线 */
    22. text-decoration: none;
    23. }
    24. a:hover{
    25. color: red;
    26. /* 加下划线 */
    27. text-decoration: underline;
    28. }
    29. .tips{
    30. background-color: pink;
    31. width: 100%;
    32. height: 30px;
    33. border: 1px dotted indianred;
    34. /* 文本居中 */
    35. text-align: center;
    36. /* 行高 要与div外面的高度一致,这时就会垂直居中*/
    37. line-height: 30px;
    38. }
    39. .center{
    40. width: 100%;
    41. height: 800px;
    42. background-color: ;
    43. border: 1px solid red;
    44. background-image: url("https://passport.jd.com/new/misc/2015/background.png");
    45. /* 设置背景图片不重复 */
    46. background-repeat:no-repeat;
    47. /* 调整背景图片位置 */
    48. background-position:center;
    49. /* 调整背景图片的大小 */
    50. /* background-size:100% 800px; <!-- 图片会失真,不建议--> */
    51. background-color:#e93854;
    52. }
    53. </style>
    54. </head>
    55. <body>
    56. <div class="top">
    57. <a href="" class="top_a">登录页面,调查问卷</a>
    58. </div>
    59. <!--中间提示-->
    60. <div class="tips">
    61. <span>依据网络安全法。。。。。。。。。。。。</span>
    62. </div>
    63. <!-- 中间主体部分 -->
    64. <div class="center">
    65. <span></span>
    66. </div>
    67. </body>
    68. </html>

    image.png

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title></title>
    
            <style>
                .shuxing{
                    width: 200px;
                    height: 200px;
                    /* 调整单个对应透明度 */
                    background-color: rgba(255,0,0);
                    color: rgba(0,0,255,.5);
    
                    /* 调整整体透明度 */
                    opacity: 0.5; 
    
                    /* 超出隐藏 */
                    overflow: auto;
                }
    
                #hangEle{
                    width: 20px;
                    height: 20px;
                    border: 1px solid red;
                    /* 行元素转块元素block  块元素转行元素inline 隐藏内容none */
                    display: block;
    
                }
    
                /* 浮动标签 */
                ul{
                    float: right;
                }
                li{
                    list-style:none;
                    float: left;
    
                    /* 内边距 */
                    padding-left: 15px;
                }
            </style>
        </head>
        <body>
            <div class="shuxing">
                诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆
                诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆
                诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆
                诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆
                诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆
                诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆诸天气荡荡,无道日兴隆
            </div>
    
            <hr/>
    
            <!-- 可以看到行元素无法自定义宽高 -->
            <span id="hangEle">1234</span>
    
            <hr/>
    
            <!-- 浮动标签 -->
            <ul>
                <li><a href="">新闻</a></li>
                <li><a href="">hao123</a></li>
                <li><a href="">地图</a></li>
                <li><a href="">视频</a></li>
                <li><a href="">贴吧</a></li>
                <li><a href="">学术</a></li>
            </ul>
        </body>
    </html>
    
    <!-- 
        块元素:(标签可以自动换行的元素是块元素)
        div h1-h6 ul p 等
    
        行元素:(多个标签位于同一行)
        span font 小标签 img a 等
     -->
    

    image.png