浮动与定位4-10自由编程作业提交
提交浮动与定位4-10自由编程作业,请老师过目
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | <!DOCTYPE html> < html lang = "en" > < head > < meta charset = "UTF-8" > < meta http-equiv = "X-UA-Compatible" content = "IE=edge" > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" > < title >Document</ title > < style > * { margin: 0; padding: 0; } .main { width: 100%; } .main .up, .down { width: 100%; float: left; } img, .text { width:25%; height: 380px; float: left; display:block; } .text { background-color: rgb(6, 253, 253); position: relative; } h3 { margin-top:20px; margin-left:20px; margin-bottom:30px; font-size:24px; color:white; } .white { margin-left:20px; margin-bottom:20px; font-size:16px; color:white; } .gray { margin-left:20px; margin-bottom:30px; font-size:14px; color:gray; } .explore { width: 138px; height: 40px; text-align: center; background-color: black; color:white; line-height:40px; position: absolute; left:50%; margin-left:-69px; } </ style > </ head > < body > < div class = "main" > < div class = "up" > < img src = "b1.jpg" alt = "" > < div class = "para1 text" > < h3 >Library</ h3 > < div class = "white" > < p >Lorem Ipsum is simply dummy text of the printing and</ p > < p >typesetting industry</ p > </ div > < div class = "gray" > < p >Lorem Ipsum has been the industry's standard dummy text ever</ p > < p >since the 1500s, when an unknown printer took a gallery of type</ p > < p >and scrambled it to make a type specimen book.</ p > </ div > < input type = "submit" value = "EXPLORE" class = "explore" > </ div > < img src = "b2.jpg" alt = "" > < div class = "para2 text" > < h3 >Library</ h3 > < div class = "white" > < p >Lorem Ipsum is simply dummy text of the printing and</ p > < p >typesetting industry</ p > </ div > < div class = "gray" > < p >Lorem Ipsum has been the industry's standard dummy text ever</ p > < p >since the 1500s, when an unknown printer took a gallery of type</ p > < p >and scrambled it to make a type specimen book.</ p > </ div > < input type = "submit" value = "EXPLORE" class = "explore" > </ div > </ div > < div class = "down" > < div class = "para3 text" > < h3 >Library</ h3 > < div class = "white" > < p >Lorem Ipsum is simply dummy text of the printing and</ p > < p >typesetting industry</ p > </ div > < div class = "gray" > < p >Lorem Ipsum has been the industry's standard dummy text ever</ p > < p >since the 1500s, when an unknown printer took a gallery of type</ p > < p >and scrambled it to make a type specimen book.</ p > </ div > < input type = "submit" value = "EXPLORE" class = "explore" > </ div > < img src = "b3.jpg" alt = "" > < div class = "para4 text" > < h3 >Library</ h3 > < div class = "white" > < p >Lorem Ipsum is simply dummy text of the printing and</ p > < p >typesetting industry</ p > </ div > < div class = "gray" > < p >Lorem Ipsum has been the industry's standard dummy text ever</ p > < p >since the 1500s, when an unknown printer took a gallery of type</ p > < p >and scrambled it to make a type specimen book.</ p > </ div > < input type = "submit" value = "EXPLORE" class = "explore" > </ div > < img src = "b4.jpg" alt = "" > </ div > </ div > </ body > </ html > |
2
收起
正在回答
1回答
同学你好,代码实现效果可以。
优化:按钮默认有边框,看着不美观
可以手动设置样式去掉边框
祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧