No edit summary |
No edit summary |
||
Line 13: | Line 13: | ||
} | } | ||
/* .nav-item defines the layout and visual boundary of the grid item. */ | |||
.nav-item { | .nav-item { | ||
position: relative; /* Enables positioning of child elements */ | position: relative; /* Enables positioning of child elements */ | ||
width: 150px; /* Fixed width for each grid item */ | width: 150px; /* Fixed width for each grid item */ | ||
height: | height: 150px; /* Fixed height for each grid item */ | ||
border-radius: 8px; | |||
border-radius: 8px; | |||
overflow: hidden; /* Ensures content stays within the bounds */ | overflow: hidden; /* Ensures content stays within the bounds */ | ||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Optional shadow effect */ | |||
transition: transform 0.3s, box-shadow 0.3s; /* Smooth hover effect */ | transition: transform 0.3s, box-shadow 0.3s; /* Smooth hover effect */ | ||
display: flex; /* Use flexbox for consistent alignment */ | display: flex; /* Use flexbox for consistent alignment */ | ||
flex-direction: column; /* Stack items vertically */ | flex-direction: column; /* Stack items vertically */ | ||
justify-content: space-between; /* Space items evenly (image and text) */ | |||
padding: 0; /* Remove default padding */ | |||
} | } | ||
/* The img fills the top part of the .nav-item with the relevant image. */ | |||
.nav-item img { | .nav-item img { | ||
width: 100%; /* Ensure the image takes full width of the parent container */ | width: 100%; /* Ensure the image takes full width of the parent container */ | ||
height: | height: 100%; /* Maintain aspect ratio */ | ||
object-fit: cover; /* Ensures the image covers the area */ | object-fit: cover; /* Ensures the image covers the area */ | ||
margin | margin: 0; /* Remove extra margin */ | ||
} | } | ||
/* The span sits below the image, aligned centrally, displaying the text. */ | |||
.nav-item span { | .nav-item span { | ||
text-align: center; /* Center the text */ | position: absolute; /* Position text over the image */ | ||
font-size: 14px; | bottom: 0; /* Align the text at the bottom */ | ||
width: 100%; /* Ensure the text spans the full width of the grid item */ | |||
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background for text */ | |||
color: #fff; /* White text for contrast */ | |||
text-align: center; /* Center the text horizontally */ | |||
font-size: 14px; | |||
font-weight: bold; | font-weight: bold; | ||
padding: 3px 0; /* Padding inside the text box */ | |||
line-height: 1 | margin: 0; /* Remove extra margin */ | ||
line-height: 1; /* Ensure proper text spacing */ | |||
display: flex; /* Ensure proper centering */ | |||
justify-content: center; /* Center text horizontally */ | |||
align-items: center; /* Center text vertically within its area */ | |||
word-wrap: break-word; /* Ensure long words wrap within the grid item */ | word-wrap: break-word; /* Ensure long words wrap within the grid item */ | ||
} | } | ||
Line 55: | Line 60: | ||
margin-top: 20px; | margin-top: 20px; | ||
padding: 10px; | padding: 10px; | ||
background-color: rgba( | background-color: rgba(0, 0, 0, 0.7); | ||
color: # | color: #fff; | ||
border-radius: 12px; | border-radius: 12px; | ||
} | } |
Revision as of 05:19, 25 November 2024
/* Main page background */
body.page-Main_Page {
background: url('https://predictive-pulse.com/images/5ean444_winter_cabin_forest_snow_night_sky_stars_peaceful_reali_fc7e7992-0c1e-4564-bf78-2930ff9dc2f9.png') no-repeat center center fixed;
background-size: cover;
}
.mainpage-navigation {
display: flex;
flex-wrap: wrap; /* Allows items to wrap to the next line */
gap: 20px; /* Adds spacing between grid items */
justify-content: center; /* Centers the items horizontally */
padding: 20px;
}
/* .nav-item defines the layout and visual boundary of the grid item. */
.nav-item {
position: relative; /* Enables positioning of child elements */
width: 150px; /* Fixed width for each grid item */
height: 150px; /* Fixed height for each grid item */
border-radius: 8px;
overflow: hidden; /* Ensures content stays within the bounds */
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Optional shadow effect */
transition: transform 0.3s, box-shadow 0.3s; /* Smooth hover effect */
display: flex; /* Use flexbox for consistent alignment */
flex-direction: column; /* Stack items vertically */
justify-content: space-between; /* Space items evenly (image and text) */
padding: 0; /* Remove default padding */
}
/* The img fills the top part of the .nav-item with the relevant image. */
.nav-item img {
width: 100%; /* Ensure the image takes full width of the parent container */
height: 100%; /* Maintain aspect ratio */
object-fit: cover; /* Ensures the image covers the area */
margin: 0; /* Remove extra margin */
}
/* The span sits below the image, aligned centrally, displaying the text. */
.nav-item span {
position: absolute; /* Position text over the image */
bottom: 0; /* Align the text at the bottom */
width: 100%; /* Ensure the text spans the full width of the grid item */
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background for text */
color: #fff; /* White text for contrast */
text-align: center; /* Center the text horizontally */
font-size: 14px;
font-weight: bold;
padding: 3px 0; /* Padding inside the text box */
margin: 0; /* Remove extra margin */
line-height: 1; /* Ensure proper text spacing */
display: flex; /* Ensure proper centering */
justify-content: center; /* Center text horizontally */
align-items: center; /* Center text vertically within its area */
word-wrap: break-word; /* Ensure long words wrap within the grid item */
}
/* Footer style */
.main-footer {
text-align: center;
margin-top: 20px;
padding: 10px;
background-color: rgba(0, 0, 0, 0.7);
color: #fff;
border-radius: 12px;
}