时间:2023-10-10 03:24:02 | 来源:网站运营
时间:2023-10-10 03:24:02 来源:网站运营
学会用HTML-flex布局制作漂亮的网页:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title></head><body><div id="intro"> <p class="peo">人物介绍</p></div><div id="pic1"> <div class="bord"> <img class="img" src="pic/Taylor.png"/> <p class="word">Taylor</p> </div> <div class="bord"> <img class="img" src="pic/yan.png"/> <p class="word">东</p> </div> <div class="bord"> <img class="img" src="pic/song.png"/> <p class="word">乔</p> </div></div></body></html>
<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> #intro { display: -webkit-flex; /* Safari */ display: flex; justify-content: center; } .peo { max-width: 10rem; border-bottom: 0.2rem solid #000000; font-family: sans-serif; font-size: 1.5rem; color: #0070C0; line-height: 3rem; } </style></head><body><div id="intro"> <p class="peo">人物介绍</p></div><div id="pic1"> <div class="bord"> <img class="img" src="pic/Taylor.png"/> <p class="word">Taylor</p> </div> <div class="bord"> <img class="img" src="pic/yan.png"/> <p class="word">东</p> </div> <div class="bord"> <img class="img" src="pic/song.png"/> <p class="word">乔</p> </div></div></body></html>
运行结果:#pic1 { display: -webkit-flex; /* Safari */ display: flex; justify-content: center;}
运行结果:.bord{ padding: 1rem 2rem;}.img { border: 0.2rem solid #e3e3e3; max-width: 15rem; height: 22rem;}.word { text-align: center;}
运行结果:<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Title</title> <style> #intro { display: -webkit-flex; /* Safari */ display: flex; justify-content: center; } .peo { max-width: 10rem; border-bottom: 0.2rem solid #000000; font-family: sans-serif; font-size: 1.5rem; color: #0070C0; line-height: 3rem; } #pic1 { display: -webkit-flex; /* Safari */ display: flex; justify-content: center; } .bord{ padding: 1rem 2rem; } .img { border: 0.2rem solid #e3e3e3; max-width: 15rem; height: 22rem; } .word { text-align: center; } </style></head><body><div id="intro"> <p class="peo">人物介绍</p></div><div id="pic1"> <div class="bord"> <img class="img" src="pic/Taylor.png"/> <p class="word">Taylor</p> </div> <div class="bord"> <img class="img" src="pic/yan.png"/> <p class="word">东</p> </div> <div class="bord"> <img class="img" src="pic/song.png"/> <p class="word">乔</p> </div></div></body></html>
今天的知识比较基础但非常实用,每天学会一个小技能,积少成多,以后就能成为大神。如果大家对网页上的实现有什么不懂的,尽请留言,OF一定会一一解答的。关键词:漂亮,布局,学会