Position Hero Title in same location on all screen sizes

Support Area › Forums › Elite › Position Hero Title in same location on all screen sizes

Viewing 2 posts - 1 through 2 (of 2 total)
URL to the page in question: http://labelleviemodesto.com
  • Author
    Posts
  • #20989
    Cody Balos
    Participant

    Hello,

    I am not a CSS ace by any means, so I am having trouble getting the hero title on my home page to stay in the upper left corner of the image for all screens. Could you help me achieve this? I am close but not quite there.

    Thank You,
    Cody

    #20998
    Bill Robbins
    Participant

    Good Morning Cody,

    It looks like you’ve done a great job on your site. Great question too. If you’re looking to have the hero text in the top left corner of the hero section, regardless of the width of the screen, you could use something like this:

    
    body.image .hero-copy {
    	display: block;
    	padding: 0;
    }
    
    h2.hero-title {
    	margin-top: 80px;
    }
    

    I have the hero content set to display as a table cell so that it can be vertically aligned a bit more easily. This swaps it back to being a block and then will move it just below the header bar.

    If you want to have it in the top left, but always below the logo, then you would need to also set a width for the hero copy div. It’ll take a few media queries to make it match the width of the header content, but that would look something like this:

    
    body.image .hero-copy {
    	display: block;
    	padding: 0;
    	width: 1140px !important;
    	float: none;
    	margin-left: auto;
    	margin-right: auto;
    }
    

    I hope that helps out. Let me know if you have any questions.

    Have a great week,
    Bill

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Position Hero Title in same location on all screen sizes’ is closed to new replies.