水平置中排版 | label置中
tags:2019年鐵人賽、css前言置中屬性百百種(例如margin:0auto;),到底這些置中差別在哪?去看定義就知道了!使用屬性這些是我對文字或inline元素排版時會用的屬性text-aline摘自w3org-wiki[1]Thetext-alignpropertydescribeshowinline-levelcontentofablockcontainerisaligned.line-height摘自w3org-wiki[2]Onablockcontainerelementwhosecontentiscomposedofinline-levelelements,line-heightspecifiestheminimalheightoflineboxeswithintheelement.Onanon-replacedinlineelement,line-heightspecifiestheheightthatisusedinthecalcu...
tags: 2019年鐵人賽 、 css 前言置中屬性百百種(例如 margin:0 auto; ),到底這些置中差別在哪?
去看定義就知道了!
使用屬性這些是我對文字或 inline 元素排版時會用的屬性
text-aline
摘自w3org-wiki[1]The text-align property describes how inline-level content of a block container is aligned.
line-height
摘自w3org-wiki[2]On a block container element whose content is composed of inline-level elements, line-height specifies the minimal height of line boxes within the element.
On a non-replaced inline element, line-height specifies the height that is used in the calculation of the line box height.
vertical-align
摘自w3.org-wiki[3]The vertical-align property affects the vertical positioning inside a line box of the boxes generated by an inline-level element.
水平置中排版範例:對文字置中
<div class="word">Sphinx</div> .word{ height: 100px; outline:1px solid; text-align:center; }範例2:對 inline 元素置中