Hi All
I want to align the heading and buttons on this page to be in the middle (vertical align center).
https://www.qcstation.com.au/index.php
I seem to be missing some?
What code am I missing? I have tried d-flex and justify-content-center with no luck?
Any help would be great.
Many Thanks
mrmbarnes
Erik_J
September 22, 2020, 10:13am
2
Hi,
The page’s content seems already centred.
The headings and buttons too it seems.
The logo and nav is separated by space in between.
What did I miss?
PaulOB
September 22, 2020, 11:09am
3
Erik_J:
What did I miss?
I think the OP wants the heading and buttons in the centre panel vertically centred.
The code is badly managed and uses magic numbers for the sticky footer with heights and negative margins and magic padding. Noe of which are needed when using flexbox.
Assuming I’ve understood correctly then the changes required are as follows.
These are over-rides and new code rather than straight replacemnets of exisiting code.
#main{padding:0;display:flex;flex-direction:column;flex:1 0 0%;}
#footer{height:auto;margin:auto 0 0;}
#master{min-height:0;display:flex;flex-direction:column;flex:1 0 0%;}
body{display:flex!important;min-height:100vh;flex-direction:column;}
#main nav + .container{margin-top:auto;margin-bottom:auto;}
The result will be this.
1 Like
Hi… thanks for that… that was exactly what I was chasing… can you also suggest a better way of doing the footer than what I am doing?
PaulOB
September 23, 2020, 7:55am
5
I already fixed that for you In the code above:).
I set up a flexbox sticky footer and removed your magic numbers
2 Likes
system
Closed
December 23, 2020, 2:55pm
6
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.