Dynamic buttons and banner in rich content editor

Jump to solution
designhelp
Community Member

I’m trying to build a homepage for a course without using tables and I’m having trouble getting the banner and buttons to line up. For reference it's a banner with 4 thin buttons beneath it… I need everything to span the entire page and line up both when accessed by clicking “pages” and when accessed by clicking “home”. What is happening is I can get everything the way it’s supposed to be for one and not the other. 

Here is the page when accessed by clicking “Home” (screenshot 1 - everything looks correct), and here is the page when accessed by clicking “Pages” (screenshot 2 - the banner hangs over the end of the 4th button and there is a visible gap). This is with banner dimensions at width="100%" height="100%" and button dimensions at width="24.5%" height="24%"

If I fix it so it looks correct when accessed by clicking ”Pages” (banner the same, buttons at width="24.6%" height="24%" ) then it hangs the 4th button out below in the next row when accessed by clicking “Home” (screenshot 3)

I’ve tried every combination of banner and button size I can think of to try and make this work and no matter what I do it looks wrong when accessing the page one of the two ways. I can’t mark this project as done until it looks correct when accessed both ways and I’m really tired of working on it. Please help, what do I do?

 

Labels (2)
0 Likes
1 Solution
arking
Community Explorer

Have you considered using the Flexbox Grid system? I think using something like this for the buttons should do it:

<div class="content-box">
<div class="grid-row">
<div class="col-sm-12
col-md-6
col-lg-3
col-xl-3">
<div class="styleguide-section__grid-demo-element"><p>Button 1</p>
</div>
</div>
<div class="col-sm-12
col-md-6
col-lg-3
col-xl-3">
<div class="styleguide-section__grid-demo-element"><p>Button 2</p>
</div>
</div>
<div class="col-sm-12
col-md-6
col-lg-3
col-xl-3">
<div class="styleguide-section__grid-demo-element"><p>Button 3</p>
</div>
</div>
<div class="col-sm-12
col-md-6
col-lg-3
col-xl-3">
<div class="styleguide-section__grid-demo-element"><p>Button 4</p>
</div>
</div>
</div>
</div>

(you'll have to fill in the button content.) This should make it so that it will line up perfect, with 4 buttons on large screens, and then two rows of two buttons on smaller screens.

View solution in original post