Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS vertical alignment Reply To: vertical alignment

#149571
__
Participant

Out of curiosity, why is that an image at all? it’s just text…?

Two examples:

— using your existing HTML markup

— using an alternative (cleaner) markup

Basically, these both do the same thing: center horizontally using text-align; center vertically by using padding/margin; then take the <h1> out of the flow by giving it an absolute position. This works very well “as-is,” but won’t work the same way if you add more elements to the <header>.