小米侧边栏修改
padding內邊距可以撐開盒子,有時候,也會讓我們修改寬度
所以小米側邊欄這個案例,文字距離左側不應該用text-indent,這樣不精確。
實際開發的合法做法是給padding值,這樣更加精確。
修改如下:
<!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>小米側邊欄</title><style>/* 1.把a轉換為塊級元素 */a {display: block;width: 200px;height: 40px;background-color: #55585a;font-size: 14px;color: #fff;line-height: 40px;text-decoration: none;padding-left: 30px;}/* 2.鼠標經過鏈接變換背景顏色 */a:hover {background-color: #ff6700;}</style> </head><body><a href="#">手機 電話卡</a><a href="#">電視 盒子</a><a href="#">筆記本 平板</a><a href="#">出行 穿戴</a><a href="#">智能 路由器</a><a href="#">健康 兒童</a><a href="#">耳機 音響</a> </body></html>總結
- 上一篇: 影像自动解译_遥感影像的解译-分类
- 下一篇: 由梦 想