Hey, Paul.
This is definitely how it should function, and this is my first implementation of a flex grid like this. I think this would be a suitable design if I added in an 8th or 9th document table for credit repair or something.
You might have already addressed this in the other thread. Pardon my misunderstanding. I’m happy that I properly imported these new styles while purging all of the old ones.
So, as I’m studying here, I see that the third value in the flex property is for flex-basis which you have employed for the width of the buttons. Flex-grow (the first value) could be changed for the change in the media queries at 400 pixels so that the buttons could have a percentage value that makes them occupy a greater width. I will begin to experiment with that (with #tablenavbuttons being slightly slimmer than #expandhide).
Uncertainties:
- Don’t know why block display is applied to the buttons.
- -webkit-appearance must be to accommodate Safari to clear out any presets.
I have made several additions already.
I used cursor:pointer to get the pointer state like link elements have on the hover state by default.
I made several artistic changes with box shadows and text shadows.
The second #expandhide button has a light green shadow on by default for the idea I have for the user to click that button on page load to show the tables. I’m thinking ahead for what the CSS will look like when the JS functions are written in accordance with my vision.
I am having difficulties altering the gaps and margins.
For the 2 #expandhide buttons, I want two things:
3. gap to be wider than 1 rem (slightly larger than #tablenavbuttons), at least on big devices. I want a little more vertical space between them, too, when they stack on top of each other
4. the margin between #tablenavbuttons and #expandhide to be greater than 2 rem on small devices (slightly more than what it is now)
This might be one of those collapsing margin moments where I get really confused, but I haven’t yet figured out how to adjust the grid. Changing the existing values doesn’t make it budge.
Being able to manipulate the space between the buttons will be important. When the buttons are clicked in the future, it’s in my mind to have text that appears that says “Please scroll down.”. At narrow widths, the user might not know anything happened without seeing a visual change after the button click.
Current markup:
<section id="tablenav">
<h3>Click to show a table: (under construction)</h3>
<div id="tablenavbuttons">
<button onclick="showPrivateBanking()">Private Banking</button>
<button onclick="showSovereignty()">Sovereignty</button>
<button onclick="showA4V()">Debt Discharge</button>
<button onclick="showDefense()">Civil & Criminal Defense</button>
<button onclick="showForms()">Forms</button>
<button onclick="showAdminProcesses()">Administrative Processes</button>
<button onclick="showNotaryPresentments()">Notary Presentments</button>
</div>
<div id="expandhide">
<button onclick="hideTables()">Hide All Tables</button>
<button onclick="expandTables()">Show Me Everything!</button>
</div>
</section> <!-- END OF TABLE NAVIGATION SECTION -->
CSS:
/*** TABLE NAVIGATION SECTION ***/
#tablenav {
border:3px pink solid;
max-width: 1280px;
margin: auto;
text-align: center;
}
#tablenav h3 { margin-top:3px; }
#tablenav button {
-webkit-appearance:none; /* this must be studied and expounded upon */
appearance:none;
display:block;
margin:0;
flex:0 0 260px;
font-size:1em;
font-weight:bold;
letter-spacing:1px;
text-decoration:none;
color:#fff;
padding:5px 0;
border:6px ridge #aa6420;
/* gradient */
background:#d99028; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Q5OTAyOCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNjYTZjMmIiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background:-moz-linear-gradient(top, #d99028 0%, #ca6c2b 100%); /* FF3.6-15 */
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#d99028), color-stop(100%,#ca6c2b)); /* Chrome4-9,Safari4-5 */
background:-webkit-linear-gradient(top, #d99028 0%,#ca6c2b 100%); /* Chrome10-25,Safari5.1-6 */
background:-o-linear-gradient(top, #d99028 0%,#ca6c2b 100%); /* Opera 11.10-11.50 */
background:-ms-linear-gradient(top, #d99028 0%,#ca6c2b 100%); /* IE10 preview */
background:linear-gradient(to bottom, #d99028 0%,#ca6c2b 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d99028', endColorstr='#ca6c2b',GradientType=0 ); /* IE6-8 */
}
#tablenav button:hover, #tablenav button:focus {
color:yellow;
background:#d14b2e; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2QxNGIyZSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNkOTkwMjgiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background:-moz-linear-gradient(top, #d14b2e 0%, #d99028 100%); /* FF3.6-15 */
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#d14b2e), color-stop(100%,#d99028)); /* Chrome4-9,Safari4-5 */
background:-webkit-linear-gradient(top, #d14b2e 0%,#d99028 100%); /* Chrome10-25,Safari5.1-6 */
background:-o-linear-gradient(top, #d14b2e 0%,#d99028 100%); /* Opera 11.10-11.50 */
background:-ms-linear-gradient(top, #d14b2e 0%,#d99028 100%); /* IE10 preview */
background:linear-gradient(to bottom, #d14b2e 0%,#d99028 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#d14b2e', endColorstr='#d99028',GradientType=0 ); /* IE6-8 */
}
#tablenavbuttons button:hover, #tablenavbuttons button:focus { text-shadow:2px 1px 1px #F60; }
#tablenavbuttons, #expandhide {
display:flex;
flex-wrap:wrap;
justify-content:center;
gap:1rem;
}
/*#tablenavbuttons { gap:1rem; }*/
#expandhide { margin:2.3rem 0 1.25rem; }
#expandhide button {
font-size:1.2em;
padding:5px 2.6rem;
flex:0 0 320px;
}
#tablenav button:hover, #tablenav button:focus {
cursor:pointer;
}
#tablenavbuttons button:hover, #tablenavbuttons button:focus {
box-shadow:0 2px 24px #FC3;
}
/* gradient */
#expandhide button:first-of-type { /* the "hide all tables" button */
background:#d62a2a; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2Q2MmEyYSIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNjZTdiNzMiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background:-moz-linear-gradient(top, #d62a2a 0%, #ce7b73 100%); /* FF3.6-15 */
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#d62a2a), color-stop(100%,#ce7b73)); /* Chrome4-9,Safari4-5 */
background:-webkit-linear-gradient(top, #d62a2a 0%,#ce7b73 100%); /* Chrome10-25,Safari5.1-6 */
background:-o-linear-gradient(top, #d62a2a 0%,#ce7b73 100%); /* Opera 11.10-11.50 */
background:-ms-linear-gradient(top, #d62a2a 0%,#ce7b73 100%); /* IE10 preview */
background:linear-gradient(to bottom, #d62a2a 0%,#ce7b73 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#d62a2a', endColorstr='#ce7b73',GradientType=0 ); /* IE6-8 */
}
#expandhide button:hover, #expandhide button:focus {
text-shadow:2px 1px 1px #ca0404;
box-shadow:0 2px 27px #ce7b73;
/* gradient */
background:#ce7b73; /* Old browsers */
/* IE9 SVG, needs conditional override of 'filter' to 'none' */
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2NlN2I3MyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNkNjJhMmEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background:-moz-linear-gradient(top, #ce7b73 0%, #d62a2a 100%); /* FF3.6-15 */
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#ce7b73), color-stop(100%,#d62a2a)); /* Chrome4-9,Safari4-5 */
background:-webkit-linear-gradient(top, #ce7b73 0%,#d62a2a 100%); /* Chrome10-25,Safari5.1-6 */
background:-o-linear-gradient(top, #ce7b73 0%,#d62a2a 100%); /* Opera 11.10-11.50 */
background:-ms-linear-gradient(top, #ce7b73 0%,#d62a2a 100%); /* IE10 preview */
background:linear-gradient(to bottom, #ce7b73 0%,#d62a2a 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#ce7b73', endColorstr='#d62a2a',GradientType=0 ); /* IE6-8 */
}
#expandhide button + button { /* the "show me everything" button */
/* gradient */
background:#64a020;
box-shadow:0 2px 27px #0BFD78;
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzY0YTAyMCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM4YmJjNjciIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background:-moz-linear-gradient(top, #64a020 0%, #8bbc67 100%);
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#64a020), color-stop(100%,#8bbc67));
background:-webkit-linear-gradient(top, #64a020 0%,#8bbc67 100%);
background:-o-linear-gradient(top, #64a020 0%,#8bbc67 100%);
background:-ms-linear-gradient(top, #64a020 0%,#8bbc67 100%);
background:linear-gradient(to bottom, #64a020 0%,#8bbc67 100%);
filter:progid:DXImageTransform.Microsoft.gradient( startColorstr='#64a020', endColorstr='#8bbc67',GradientType=0 );
}
#expandhide button + button:hover, #expandhide button + button:focus {
text-shadow:2px 1px 1px #3C0;
box-shadow:0 2px 27px #20B00B;
/* gradient */
background:#8bbc67;
background:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzhiYmM2NyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiM2NGEwMjAiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background:-moz-linear-gradient(top, #8bbc67 0%, #64a020 100%);
background:-webkit-gradient(linear, left top, left bottom, color-stop(0%,#8bbc67), color-stop(100%,#64a020));
background:-webkit-linear-gradient(top, #8bbc67 0%,#64a020 100%);
background:-o-linear-gradient(top, #8bbc67 0%,#64a020 100%);
background:-ms-linear-gradient(top, #8bbc67 0%,#64a020 100%);
background:linear-gradient(to bottom, #8bbc67 0%,#64a020 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8bbc67', endColorstr='#64a020',GradientType=0 );
}
/* end of table navigation section */
@media screen and (max-width: 400px) {
#expandhide { margin-top:3.4rem; } /* not working to add space between #tablenavbuttons and #expandhide */
#expandhide button {
font-size:1.1em;
padding:5px 5rem;
flex:0 0 280px;
margin-top:3.4rem;
}
}
Thanks!
-ty