The CSS:
*{
margin: 0;
border: 0;
padding: 0;
box-sizing: border-box;
}
img,source{
display:block;
}
p,span,legend,input,a.link,figcaption{
font-family: roboto, helvetica, arial, sans-serif;
color: var(--textColor);
font-size: 1.2rem;
padding: 5px;
}
a.link{
color: #900;
}
h1,h2,h3,h4,h5,h6{
font-family: bree, Times New Roman, serif;
color: var(--headlineColor);
padding: 5px;
}
html{
height: 100%;
}
body{
min-height: 100%;
display: grid;
grid-template-rows: auto 1fr auto;
background-color: var(--outerBackgroundColor);
}
nav {
display: flex;
flex-direction: column;
text-align: center;
background-color: var(--headlineColor);
margin: auto;
}
a.menu{
display: block;
padding: 10px 15px;
font-family: roboto, helvetica, arial, sans-serif;
font-weight: bold;
color: white;
text-decoration: none;
transition: .3s ease-in-out;
}
.menu:hover:not(.active){
color: var(--headlineColor);
background-color: white;
}
a.active{
color: #111;
background-color: #ccc;
}
footer.footer p{
font-size: smaller;
}
main.index{
max-width: 650px;
margin: 0 auto;
}
section.index, footer.footer{
background-color: var(--backgroundColor);
}
section.index{
height: 100%;
}
.terms{
display: none;
}
main.contact{
max-width: 650px;
margin: 0 auto;
}
section.contact{
background-color: var(--backgroundColor);
height: 100%;
}
input.send, a.send{
border: outset 3px #666;
border-radius: 3px;
color: black;
background-color: #ccc;
margin: 5px;
}
p.required{
font-size: small;
color: red;
}
span.required{
font-size: small;
color: red;
padding-left: 0;
}
/*To make the asterisk next too the word 'email' closer than it otherwise would be if it had the default padding of 5px*/
span#email{
padding-right: 2px;
}
fieldset{
border: solid 1px black;
border-radius: 4px;
padding: 0 5px 2px 5px;
background-color: white;
margin: 0 5px;
}
legend{
font-size: small;
padding: 3px;
}
input:not([type="submit"]), textarea{
width: 100%;
}
a.link{
text-decoration: none;
}
main.login{
max-width: 650px;
margin: auto;
}
section.login{
background-color: var(--backgroundColor);
min-width: 300px;
min-height: 300px;
height: auto;
border-radius: 4px;
display: grid;
}
article.logout{
margin: auto;
}
/* To centre the login button on the goodbye.php page */
p.center{
display: grid;
}
a.center{
margin: auto;
}
main.gallery{
width: 100%;
display: grid;
justify-items: center;
}
article.gallery{
display: grid;
grid-template-rows: repeat(6, auto);
gap: 15px;
margin-bottom: 15px;
}
img.gallery{
width: calc(98vw - 15px);
height: calc(98vw - 15px);
object-fit: contain;
object-position: 50% 0%;
}
/*The next few items are to do with lifting the figcaption to the bottom of the image*/
figure.card{
position: relative;
z-index: -100; /* On the gallery page if all the pictures on the bottom row are landscape then the bottom of the <img> box sometimes goes over the top of the navigation buttons until this z-index is added to make sure the <IMG> goes behind the navigation buttons. */
overflow: hidden; /*This line is to solve a problem where if the bottom line of pictures is all landscapes of short "height" then the empty bottom bit of the <img> block would protrude below the <figure> block and create extra space BELOW the footer, eg page 27 on full screen.*/
}
figcaption.caption{
position: absolute;
width: 100%;
}
figcaption{
height: auto;
background-color: var(--backgroundColor);
}
button.previous,button.next, button.start,button.end{
border: outset 3px #666;
border-radius: 3px;
color: black;
background-color: #ccc;
padding: 10px;
font-weight: bold;
transition: .3s ease-in-out;
}
button.previous:hover,button.next:hover, button.start:hover,button.end:hover{
border: inset 3px #666;
border-radius: 3px;
color: white;
background-color: #333;
padding: 10px;
font-weight: bold;
transition: .3s ease-in-out;
}
/* styling for the buttons that would take the gallery "off the end" if they worked */
button.previousGhost,button.nextGhost, button.startGhost,button.endGhost{
border-radius: 3px;
color: #fff;
background-color: #ddd;
padding: 10px;
transition: .3s ease-in-out;
}
div.buttons{
width: 100%;
display: flex;
}
div.buttons{
flex-direction: column;
}
span.fa-angle-double-left, span.fa-angle-left, span.fa-angle-double-right, span.fa-angle-right{
display: none;
}
span.fa-angle-double-up, span.fa-angle-up, span.fa-angle-down, span.fa-angle-double-down{
display: inline;
}
input#number{
width: 4rem;
font-weight: bold;
border: inset 3px #666;
background-color: #ccc;
color: #333;
transition: .3s ease-in-out;
}
input#number:hover{
border: inset 3px #666;
background-color: #333;
color: #ccc;
}
button#numberSubmit{
color: #333;
background-color: #ccc;
padding: 5px;
border: 3px outset #666;
transition: .3s ease-in-out;
}
button#numberSubmit:hover{
color: #ccc;
background-color: #666;
padding: 5px;
border: 3px outset #666;
}
span.goTo{
border: outset 3px #666;
text-align: center;
}
h1.treeHead{
text-align: center;
}
figure.tree{
width: 1200px;
display: grid;
margin: auto;
}
figcaption.tree{
width: auto;
}
/* Border colors for testing */
/*
main.gallery{
border: red solid .1vw;
}
article.gallery{
border: blue solid .1vw;
}
figure.card{
background-color: #60EFF1;
border: yellow solid .1vw;
}
img.gallery {
border: green solid .1vw;
}
*/
/* *** Tablet *** */
@media screen and (min-width: 600px)
and (max-width: 991px){
p,span,legend,input,a.link,figcaption{
font-size: 1.1rem;
}
article.gallery{
width: calc(100% - 30px);
grid-template-rows: repeat(3, auto);
grid-template-columns: repeat(2, calc((100% - 15px)/2));
}
img.gallery{
width: calc((95vw - 15px)/2);
height: calc((95vw - 15px)/2);
object-fit: contain;
object-position: 50% 0%;
}
figcaption.caption{
width: calc((95vw - 15px)/2);
}
}
/* *** Desktop *** */
@media screen and (min-width: 992px){
p,span,legend,input,a.link,figcaption{
font-size: 1rem;
}
article.gallery{
width: calc(100% - 30px);
grid-template-rows: repeat(2, auto);
grid-template-columns: repeat(3, calc((100% - 30px)/3));
}
img.gallery{
width: calc((95vw - 30px)/3);
height: calc((95vw - 30px)/3);
object-fit: contain;
object-position: 50% 0%;
}
figcaption.caption{
width: calc((95vw - 30px)/3);
}
}
/* *** tablet and desktop *** */
@media screen and (min-width: 600px) {
nav {
flex-direction: row;
}
a.right{
margin-left: auto;
}
div.buttons{
flex-direction: row;
}
button.previous,button.next, button.start,button.end{
width: 7rem;
margin: 10px;
}
button.previous:hover,button.next:hover, button.start:hover,button.end:hover{
margin: 10px;
}
button.start,button.start:hover{
margin-right: auto;
}
button.end,button.end:hover{
margin-left: auto;
}
span.fa-angle-double-left, span.fa-angle-left, span.fa-angle-double-right, span.fa-angle-right{
display: inline;
}
span.fa-angle-double-up, span.fa-angle-up, span.fa-angle-down, span.fa-angle-double-down{
display: none;
}
button.previousGhost,button.nextGhost, button.startGhost,button.endGhost{
width: 7rem;
margin: 10px;
}
button.startGhost{
margin-right: auto;
}
button.endGhost{
margin-left: auto;
}
span.goTo{
margin: 10px;
}
}