i标签使用 text-align 无法实现图标居中:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <style type="text/css">div{ font-size: 60px; color:violet; font-style: italic; font-weight: bold; text-align: center; font-family: 'myfont'; text-decoration-line: line-through; text-transform: uppercase; text-shadow: 10px -10px 5px purple; } i.my{ font-size: 50px; color: royalblue; /*line-height: inherit;*/ text-align: center; } </style> <link rel="stylesheet" href="./font-awesome-4.7.0/css/font-awesome.min.css"> <body> <div>hello </div> <i class="