0

HTML Alignment

I know that you can move text to the center of an HTML document with the text-align: center; property in CSS, but I do not know how to align other items like tables or buttons to the center. Could you maybe show me how to align the other items to the center? Thank you for your help.

6th Jun 2024, 2:52 AM
Sergey Kuznetsov
Sergey Kuznetsov - avatar
2 ответов
+ 3
Aligning containers, block-level elements can get quite tricky. Ultimately it comes down to the layout of the page, and most commonly this would be handled by CSS tools such as Grid or Flexbox. https://elementor.com/blog/center-a-div/ https://css-tricks.com/snippets/css/a-guide-to-flexbox/
6th Jun 2024, 3:24 AM
Tibor Santa
Tibor Santa - avatar
+ 1
yes, as Tibor Santa said, using containers like grid or flexbox is the better method. Instead of positioning the DOM elements individually, put them in containers that positions them for you.
6th Jun 2024, 5:36 AM
Bob_Li
Bob_Li - avatar