Skip to content
Sign upLog in

How can I center my <H1> elements

Profile icon
TriciaKennedy

Trying to center h1 element tag

You are viewing a single comment. View All
Profile icon
timmy_i_chen

Have you looked into using text-align: center; in your CSS yet?

Profile icon
roboticmind
should also work depending on how you have it set up
Profile icon
TriciaKennedy

ok I got it centered but I am trying to center a img [email protected]

Profile icon
Yamboy1

@TriciaKennedy
You could use the following css

img { margin-left: auto; margin-right: auto; display: block; }

Heres an example repl: https://repl.it/@Yamboy1/WellmadeOnerlookedSites

Profile icon
TriciaKennedy