- This topic has 11 replies, 2 voices, and was last updated 6 years ago by
David.
-
AuthorPosts
-
March 10, 2020 at 2:53 am #1190535
Heinrich
hi team,
i want to place a small picture 150*150 on the right side of my page hero. don`t find the answer in the docs.March 10, 2020 at 5:24 am #1190648David
StaffCustomer SupportHi there,
would this be the same picture for all of your pages / products ?
March 10, 2020 at 5:49 am #1190674Heinrich
yes, for all pages where this element is configured for (its a symbol)
March 10, 2020 at 6:01 am #1190689David
StaffCustomer SupportYou will need to edit the Header Element and add this HTML after your
<h1>Title</h1>:<img class="hero-image" alt="your-alt-name-for-image" src="full_url_to_image/image.jpg" />Update the URL and ALT – i would recommend choosing an image that is the correct size you want it displayed.
Then add this CSS to your site to align the image to the right and vertically center it with it the title.
.page-hero .inside-page-hero { display: flex; align-items: center; } .hero-image { margin-left: auto; }March 10, 2020 at 6:52 am #1190907Heinrich
is it possible with a png-file? followed your instruction, but picture is not shown.
next. how to handle the resizing in mobile? alternative hidden in mobile?
March 10, 2020 at 6:56 am #1190914David
StaffCustomer SupportCheck the URL you have used in the img src as it is broken.
.png files are fine to use.How would you want it positioned on mobile ?
March 10, 2020 at 7:23 am #1190931Heinrich
hi david, url is working now. for mobile two options: size reduced (50%) or not visible. can you provide me the code for both options?
March 10, 2020 at 8:22 am #1191009David
StaffCustomer SupportTo hide the image edit your img html to include
hide-on-mobileas class eg.:<img class="hero-image hide-on-mobile" alt="your-alt-name-for-image" src="full_url_to_image/image.jpg" />OR add this to change its size:
@media (max-width: 768px) { img.hero-image { width: 75px; height: auto; } }Adjust the
75pxto suitMarch 10, 2020 at 9:06 am #1191072Heinrich
both are working fine, tks a lot. last small thing. the title is not vertical centered. seems there is a padding after it. where to change?
March 10, 2020 at 9:10 am #1191077David
StaffCustomer SupportAah yeah – add this CSS to remove its bottom margin:
.page-hero h1 { margin-bottom: 0; }March 10, 2020 at 9:12 am #1191080Heinrich
perfect, tks a lot.
March 10, 2020 at 9:13 am #1191084David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.