- This topic has 5 replies, 2 voices, and was last updated 4 years, 3 months ago by Tom.
-
AuthorPosts
-
January 5, 2020 at 9:52 am #1122822Matteo
Hi,
I’m trying to create a page hero like this but it seems too difficult for me to fix the actual that I create reading the examples in the documentation.
I’d like to:
1. Move the text and the button on the left (changing font and size);
2. Add a pre-headline;
3. Move the image on the right (resized based on device like in that site).How can i fix it?
Thanks.
January 5, 2020 at 5:37 pm #1123092TomLead DeveloperLead DeveloperHi there,
What they’re doing there is somewhat complex.
They’ve created two columns with HTML inside the headlines/button. Then they’ve used absolute images to achieve the responsive images. Something like that takes a lot of tweaking, so it’s probably easier to just change the images out for desktop/mobile.
Try something like this:
<div class="hero-columns"> <div class="hero-text"> <h3>Pre-heading stuff here.</h3> <h1>Main heading here</h1> <p>Main text here.</p> <a class="button" href="#">Button</a> </div> <div class="hero-images"> <img src="URL TO DESKTOP IMAGE" class="hide-on-mobile" alt="" /> <img src="URL TO MOBILE IMAGE" class="hide-on-desktop hide-on-tablet" alt="" /> </div> </div>
Then your CSS:
.hero-columns { display: flex; align-items: center; }
Won’t be perfect, but it should definitely serve as a solid starting point ๐
January 6, 2020 at 3:12 am #1123322MatteoJust insert your code.
I also added a tablet version image.
It seems much better but I need a developer to complete the job.
Someone able to do the work only with Elements, Sections, HTML, CSS?
January 6, 2020 at 9:53 am #1123759TomLead DeveloperLead DeveloperHi there,
If you remove this code in your custom CSS, it should look a lot better:
.inside-page-hero { display: -ms-grid; display: grid; grid-template-areas: "left right"; -ms-grid-columns: 50% 50%; grid-template-columns: 50% 50%; }
If it’s close and needs some tweaking, let me know specifically what you need changed and I’ll try to help.
If you need a developer to work with continuously, something like codeable.io might be worth checking out ๐
January 7, 2020 at 1:49 am #1124346MatteoThank you.
I’d like to know how to:
1. Change font type size and color of H1, H2, H3 only in page hero;
2. Change the distance (margin and/or padding?) of the classes “hero-columns” and “hero-images” and/or the elements inside (text and image) from top, bottom, right, left in different device (desktop, tablet, mobile).
3. Align my photo to the bottom border in every device.January 7, 2020 at 8:13 am #1124816TomLead DeveloperLead DeveloperHi there,
1. To target these elements, you can do this:
.hero-columns h1 { font-size: 30px; color: #000; } .hero-columns h2 { font-size: 30px; color: #000; }
And so on..
2. You could try just tweaking the
hero-images
padding?:.hero-images { padding: 30px; } @media (max-width: 1000px) { .hero-images { padding: 20px; } } @media (max-width: 768px) { .hero-images { padding: 10px; } }
3. Add this CSS:
.hero-images { align-self: flex-end; } .hero-images img { vertical-align: bottom; }
-
AuthorPosts
- You must be logged in to reply to this topic.