知识点dl dt dd, 浮动,静态页面

不念不忘少年蓝@ 2021-06-26 16:06 368阅读 0赞
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title></title>
  7. <link rel="stylesheet" type="text/css" href="css/css.css"/>
  8. </head>
  9. <body>
  10. <section class="container">
  11. <h2 class="title">本周主打</h2>
  12. <!-------intro-------------->
  13. <div class="intro clearfix">
  14. <dl class="item">
  15. <dt>
  16. <a href="#"><img src="images/011.jpg" alt=""></a>
  17. </dt>
  18. <dd>
  19. <h3>妙用性格</h3>
  20. <p>讲师:张勤</p>
  21. <p>技术:共12集全</p>
  22. <p>类型:生活</p>
  23. <p>性格无时无刻不在左右...</p>
  24. <div class="btn">
  25. <a class="buy" href="#"><span>购买</span></a>
  26. <a class="pre" href="#">预览</a>
  27. </div>
  28. </dd>
  29. </dl>
  30. <dl class="item">
  31. <dt>
  32. <a href="#"><img src="images/012.jpg" alt=""></a>
  33. </dt>
  34. <dd>
  35. <h3>妙用性格</h3>
  36. <p>讲师:张勤</p>
  37. <p>技术:共12集全</p>
  38. <p>类型:生活</p>
  39. <p>性格无时无刻不在左右...</p>
  40. <div class="btn">
  41. <a class="buy" href="#"><span>购买</span></a>
  42. <a class="pre" href="#">预览</a>
  43. </div>
  44. </dd>
  45. </dl>
  46. </div>
  47. <!---------intro结束---------------->
  48. <!--list-->
  49. <div class="list clearfix">
  50. <dl>
  51. <dt><a href="#"><img src="images/021.jpg" alt="pic"></a></dt>
  52. <dd>
  53. <h3>妙用性格</h3>
  54. <p>讲师:张勤</p>
  55. <p>技术:共12集全</p>
  56. </dd>
  57. </dl>
  58. <dl>
  59. <dt><a href="#"><img src="images/022.jpg" alt="pic"></a></dt>
  60. <dd>
  61. <h3>妙用性格</h3>
  62. <p>讲师:张勤</p>
  63. <p>技术:共12集全</p>
  64. </dd>
  65. </dl>
  66. <dl>
  67. <dt><a href="#"><img src="images/023.jpg" alt="pic"></a></dt>
  68. <dd>
  69. <h3>妙用性格</h3>
  70. <p>讲师:张勤</p>
  71. <p>技术:共12集全</p>
  72. </dd>
  73. </dl>
  74. <dl>
  75. <dt><a href="#"><img src="images/024.jpg" alt="pic"></a></dt>
  76. <dd>
  77. <h3>妙用性格</h3>
  78. <p>讲师:张勤</p>
  79. <p>技术:共12集全</p>
  80. </dd>
  81. </dl>
  82. </div>
  83. <!--------------list结束---------------->
  84. </section>
  85. </body>
  86. </html>

css.css

  1. body,h2,h3,dl,dt,dd,p{
  2. margin:0;
  3. padding:0;
  4. }
  5. a{
  6. text-decoration:none;
  7. }
  8. img{
  9. border:0;
  10. vertical-align:top;
  11. }
  12. body{
  13. font-size:12px;
  14. font-family:"微软雅黑";
  15. }
  16. .clearfix:after{
  17. content:"";
  18. display:block;
  19. clear:both;
  20. overflow:hidden;
  21. visibility:hidden;
  22. height:0;
  23. }
  24. .container{
  25. padding:0 29px 26px 31px;
  26. width:686px;
  27. border:1px solid #bfbfbf;
  28. /* box-sizing:border-box; */
  29. margin:50px auto;
  30. }
  31. .title{
  32. height:84px;
  33. font-size:20px;
  34. font-weight:normal;
  35. padding-left:27px;
  36. line-height:84px;
  37. background:url(../images/logo.fw.png) no-repeat left center;
  38. margin-bottom:1px;
  39. }
  40. /*intro*/
  41. .intro{
  42. margin-bottom:40px;
  43. }
  44. .item{
  45. width:310px;
  46. height:182px;
  47. float:left;
  48. }
  49. .intro dl:first-child{
  50. margin-right:62px;
  51. }
  52. .item dt{
  53. width:129px;
  54. height:180px;
  55. border:1px solid #bfbfbf;
  56. float:left;
  57. }
  58. .item dd{
  59. width:160px;
  60. height:182px;
  61. float:right;
  62. }
  63. .container dd h3{
  64. height:16px;
  65. line-height:16px;
  66. font-size:16px;
  67. color:#34BFE1;
  68. font-weight:normal;
  69. margin-bottom:12px;
  70. }
  71. .container dd p{
  72. height:26px;
  73. line-height:26px;
  74. font-size:14px;
  75. color:#6a6a6a;
  76. }
  77. .btn {
  78. height:30px;
  79. margin-top:20px;
  80. }
  81. .btn .buy{
  82. width:66px;
  83. height:26px;
  84. display:block;
  85. background:#00AED8;
  86. padding:1px;
  87. margin-right:10px;
  88. /* margin-right:4px */
  89. float:left;
  90. }
  91. .btn .buy span{
  92. display:block;
  93. width:64px;
  94. height:24px;
  95. line-height:24px;
  96. text-align:center;
  97. color:#fff;
  98. border:1px solid #6BD2EB;
  99. }
  100. .btn .pre{
  101. display:block;
  102. width:64px;
  103. height:24px;
  104. line-height: 26px;
  105. text-align:center;
  106. border:2px solid #00AED8;
  107. float:left;
  108. }
  109. /*------------list---------*/
  110. .list dl{
  111. width:130px;
  112. height:174px;
  113. float:left;
  114. margin-right:55px;
  115. }
  116. .list dl:last-of-type{
  117. margin:0;
  118. }
  119. .list dt{
  120. width:130px;
  121. height:90px;
  122. margin-bottom:8px;
  123. }
  124. .list dd h3{
  125. height:24px;
  126. line-height:24px;
  127. margin:0;
  128. }

发表评论

表情:
评论列表 (有 0 条评论,368人围观)

还没有评论,来说两句吧...

相关阅读

    相关 dldddt

    定义和用法 <dl> 标签定义了定义列表(definition list)。 <dl> 标签用于结合 [<dt>][dt] ( 标签定义一个描述列表的项目/名字)和 [

    相关 dl,dt,dd 描述列表

    使用`< dl>`、`< dt>`和`< dd>`三个标签可以定义描述列表。 首先从标签的名称入手理解它们的作用: (1).dl:英文全称是definitio...