CMS Development

JJ_Anderson
Participant

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

Under the "Our Values" heading on https://preview.hs-sites.com/_hcms/preview/template/multi?hs_preview_key=8VaQxbVLLGNpOCdLB2YvFg&is_b... how do I make the 3 module group columns equal height?

Screen Shot 2020-12-02 at 7.36.02 AM.png

0 Upvotes
1 Accepted solution
piersg
Solution
Key Advisor

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

Looks like that isn't applying to the right wrapping div because HubL adds a bunch of extra divs on the sly. If you change ".equal-column-height" for ".equal-column-height > .row-fluid-wrapper > .row-fluid" that should work.

 

View solution in original post

13 Replies 13
dennisedson
HubSpot Product Team
HubSpot Product Team

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

well this was a fun one to follow 😆

0 Upvotes
piersg
Key Advisor

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

Happens to the best of us!

0 Upvotes
piersg
Key Advisor

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

No worries. I actually just noticed something, your media query for mobile-padding isn't closed, so it's containing the CSS rule you want for columns, making it invalid

  @media screen and (max-width: 767px) {
    .mobile-padding {
      padding: 25px !important;
    }
 } <----- you need this closing bracket
  .equal-column-height > .row-fluid-wrapper > .row-fluid {
    display: flex;
  }
@media (max-width: 768px) {
  .equal-column-height > .row-fluid-wrapper > .row-fluid {
    flex-direction: column;
  }
}
JJ_Anderson
Participant

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

*facepalm* lol that was the issue

0 Upvotes
piersg
Key Advisor

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

The CSS stylings aren't being applied to the page. The mobile-padding rule isn't being applied either. How and where are these styles being added?

0 Upvotes
JJ_Anderson
Participant

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

But strangely, adding the CSS to our primary stylesheet worked. No idea why it wouldn't take on the page template though. Anyhow, thank you for the help!

0 Upvotes
JJ_Anderson
Participant

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

@piersg I added them here in the actual page template:

Screen Shot 2020-12-02 at 3.36.24 PM.png

Strange, because the first CSS command is being applied. Not sure why the other 2 wouldn't be?

 

Screen Shot 2020-12-02 at 3.36.11 PM.png

0 Upvotes
piersg
Key Advisor

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

The first rule, mobile-padding, isn't being applied. The padding for those elements is 50px all the way around. I think you need to add them in the head. If you copy-paste that style block into the head html area in advanced settings of the page, does it work?

Screenshot 2020-12-02 at 20.44.10.png

0 Upvotes
JJ_Anderson
Participant

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

@piersg I moved the code there instead, but still no luck. For what it's worth, the top bit of CSS code actually was working on the mobile preview even when I had it in the other box, see:

 

Screen Shot 2020-12-02 at 3.50.39 PM.png

0 Upvotes
piersg
Solution
Key Advisor

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

Looks like that isn't applying to the right wrapping div because HubL adds a bunch of extra divs on the sly. If you change ".equal-column-height" for ".equal-column-height > .row-fluid-wrapper > .row-fluid" that should work.

 

JJ_Anderson
Participant

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

@piersg still no luck 😞

 

Screen Shot 2020-12-02 at 3.30.14 PM.png

0 Upvotes
piersg
Key Advisor

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

Hi @JJ_Anderson, add display: flex to the wrapping module group (the one that contains all three).

 

I would add it as a CSS class in the styling options, because you need to add a media query to make the flex-direction a column for 768px and lower, otherwise they won't stack on tablet/mobile.

.myClass {
  display: flex;
}
@media (max-width: 768px) {
  .myClass {
    flex-direction: column;
  }
}

Screenshot 2020-12-02 at 16.37.25.png

0 Upvotes
JJ_Anderson
Participant

Equal Height for 3 Module Groups in Parent Module Group

SOLVE

@piersg Thanks! I added the class and CSS but the preview doesn't seem to be updating?Screen Shot 2020-12-02 at 12.07.44 PM.pngScreen Shot 2020-12-02 at 12.08.01 PM.png

0 Upvotes