Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the considerations for using element centering in HTML

Shulou Source: shulou.com Published: 2022-06-03 15:01:20 11月14日 Update

This article will explain in detail what you need to pay attention to when using elements in HTML. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Do not use positioning

Horizontal center: text-align = center; (inheritable)

Center vertically: margin:0 auto; (block-level elements)

Others in the middle: 1. Text center: parent element sets high child element sets high line-height=height (parent element)

two。 Picture center: vertical-aign:middle

Tags: Elements positioning height articles items notes pictures more minus signs good practical content width text text articles levels knowledge questions a. Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia macOS Docker Huawei Xiaomi