[Resolved] Page Hero center heading

Home Forums Support [Resolved] Page Hero center heading

Home Forums Support Page Hero center heading

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1037388
    Paul

    Hey,

    Using VH as height for the page-hero class… Having troubles getting the text to not center. Let me know if you know a fix. Thanks πŸ˜‰

    #1037390
    Paul
    .page-hero {
    	background-image: linear-gradient(180deg, #2d5488 0%, #3ab3d7 100%);
    	min-height: 21vh;
    	color: #fff;
    }
    .inside-page-hero {
    	position: relative;
        vertical-align: middle;
    }
    .page-hero h1 {
    	font-weight: 600;
    }
    #1037391
    Leo
    Staff
    Customer Support

    Hi there,

    So you don’t want the text to center?

    What’s your horizontal alignment setting here?
    https://docs.generatepress.com/article/how-to-create-a-page-hero/#step-5-position-the-content

    Let me know πŸ™‚

    #1037395
    Paul

    Hey,

    Yea i want it centered.. also centered vertically … But I am using VH as the container height..

    #1037399
    Leo
    Staff
    Customer Support

    Edit your CSS to this:

    .page-hero {
        background-image: linear-gradient(180deg, #2d5488 0%, #3ab3d7 100%);
        min-height: 21vh;
        color: #fff;
        display: flex;
        align-items: center;
    }
    #1037403
    Paul

    Holy smoke πŸ˜‰ Thank you very much!

    #1037404
    Leo
    Staff
    Customer Support

    Flexbox is super useful for things like this if you are interested:
    https://css-tricks.com/snippets/css/a-guide-to-flexbox/

    Glad I could help πŸ™‚

    #1037405
    Paul

    Thanks !

    #1037409
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.