CSS
[CSS] 아이콘, 텍스트 수직 수평 정렬
힘없는염소
2016. 6. 9. 17:44
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 | <!DOCTYPE html> <html lang="ko"> <head> <meta charset="utf-8"> <style> li { position: relative; background: skyblue; margin: 5px 0 0 0; height: 50px; line-height: 50px; width: 200px; } i { position: absolute; top:10px; left: 10px; display: inline-block; width: 30px; height: 30px; background: red; text-indent: -1000px; overflow: hidden; } span { padding: 0 0 0 60px; } </style> </head> <body> <ul> <li><i>아이콘</i><span>텍스트1</span></li> <li><i>아이콘</i><span>텍스트2</span></li> <li><i>아이콘</i><span>텍스트3</span></li> </ul> </body> </html> |
반응형