CMS Development

tette_engage
トップ投稿者

Aligning objects (using flex-box)

解決

Hi!

I'm trying to vertically align an image and a text-box, and I stumbled upon this post suggesting using flex-box:

https://community.hubspot.com/t5/CMS-Development/Vertically-Aligning-text-element-within-a-container...


However, I can't get it to work? Am I putting the codes in the wrong places as nothing has changed? I first put the codes directly into the modules' inline styling in design tools, after which I gave them classes (.kuva-boxi (the wrapper) / .kuva-boxi-kuva (the pic) / .kuva-boxi-teksti (the text)) and added the codes into the main css.

 

It's the 'KEINO-SOVELLUKSEN EDUT' row if you want to inspect 🙂

 

https://www.prometheusone.io/home-keino-0?hs_preview=qOglKNzO-35998890977

 

0 いいね!
1件の承認済みベストアンサー
alyssamwilie
解決策
名誉エキスパート | Elite Partner
名誉エキスパート | Elite Partner

Aligning objects (using flex-box)

解決

Yep, it's just the styling being in the wrong place. @tette_engage I would remove the .kuva-boxi-kuva and .kuva-boxi-teksti wrappers so that the hubspot widget-spans are whats getting aligned. Then move your flex css into .kuva-boxi > .row-fluid-wrapper > .row-fluid.

screenshot.jpg
screenshot-www.prometheusone.io-2020.10.20-20_50_46.png

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

元の投稿で解決策を見る

3件の返信
dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

Aligning objects (using flex-box)

解決

Hello @tette_engage !

Thanks for posting the question!  Just to confirm, you want to top align the image and the text?  So the top of the phone would match the position of the text?  Any visual aid you have would help!  Flexbox is definitely the way I would go about this.  I did not see the flex property being applied to the container of the two columns, though.  I see it a couple divs up.  (See attached screengrab from inspector) 

@Jake_Lett , @SandyG1 , @alyssamwilie -- what do you all think 🙂

(ps Firefox Developer Edition for the win with its highlighting of flex or grid content!)

Developer_Tools_-_Home-keino_-_https___www_prometheusone_io_home-keino-0_hs_preview_qOglKNzO-35998890977.png

0 いいね!
alyssamwilie
解決策
名誉エキスパート | Elite Partner
名誉エキスパート | Elite Partner

Aligning objects (using flex-box)

解決

Yep, it's just the styling being in the wrong place. @tette_engage I would remove the .kuva-boxi-kuva and .kuva-boxi-teksti wrappers so that the hubspot widget-spans are whats getting aligned. Then move your flex css into .kuva-boxi > .row-fluid-wrapper > .row-fluid.

screenshot.jpg
screenshot-www.prometheusone.io-2020.10.20-20_50_46.png

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
tette_engage
トップ投稿者

Aligning objects (using flex-box)

解決

THANK YOU, THANK YOU, THANK YOU! That did the trick 🙂 Also, I can apparently leave the css-class to the text to for e.g. mobile styling, if someone else is wondering 🙂