Enhance responsive design in CSS for better mobile usability

This commit is contained in:
vista-man
2025-02-27 09:50:17 +01:00
parent 4670c94d06
commit d6985c2e54
2 changed files with 37 additions and 5 deletions

View File

@@ -4,13 +4,16 @@ body {
padding: 50px; padding: 50px;
background-color: #f9f9f9; background-color: #f9f9f9;
} }
h1 { h1 {
color: #F56E28; color: #F56E28;
} }
p { p {
font-size: 1.2em; font-size: 1.2em;
margin-top: 20px; margin-top: 20px;
} }
button { button {
margin-top: 30px; margin-top: 30px;
padding: 10px 20px; padding: 10px 20px;
@@ -20,6 +23,27 @@ button {
cursor: pointer; cursor: pointer;
font-size: 1.1em; font-size: 1.1em;
} }
button:hover { button:hover {
background-color: #F56E28; background-color: #F56E28;
} }
/* Responsive design */
@media (max-width: 768px) {
body {
padding: 20px;
}
h1 {
font-size: 1.5em;
}
p {
font-size: 1em;
}
button {
font-size: 1em;
padding: 10px 15px;
}
}

View File

@@ -33,6 +33,7 @@ body {
transform: translate(0, 0); transform: translate(0, 0);
justify-content: space-around; /* Spread the menu items */ justify-content: space-around; /* Spread the menu items */
flex-wrap: nowrap; /* Ensure all items are in a single row */ flex-wrap: nowrap; /* Ensure all items are in a single row */
overflow-x: auto; /* Enable horizontal scrolling */
} }
.menu-bar.dark { .menu-bar.dark {
@@ -211,19 +212,19 @@ body {
/* Responsive design */ /* Responsive design */
@media (max-width: 768px) { @media (max-width: 768px) {
.menu-bar { .menu-bar {
flex-wrap: wrap; /* Allow wrapping of menu items */ flex-wrap: nowrap; /* Ensure all items are in a single row */
width: 100%; /* Use full width for menu bar */ width: 100%; /* Use full width for menu bar */
top: 0; /* Fix the menu bar to the top */ top: 0; /* Fix the menu bar to the top */
left: 0; left: 0;
transform: translate(0, 0); transform: translate(0, 0);
justify-content: space-around; /* Spread the menu items */ justify-content: flex-start; /* Align items to the start */
flex-wrap: wrap; /* Ensure all items are in a single row */ overflow-x: auto; /* Enable horizontal scrolling */
padding: 10px; /* Add padding for better spacing */ padding: 10px; /* Add padding for better spacing */
} }
.menu-item { .menu-item {
flex: 1 1 48%; /* Make each menu item take half width */ flex: none; /* Remove flex-grow to fit all items in a single row */
margin: 5px 1%; /* Add margin between items */ margin: 5px; /* Add margin between items */
font-size: 1em; /* Adjust font size for better readability */ font-size: 1em; /* Adjust font size for better readability */
} }
@@ -256,6 +257,13 @@ body {
bottom: 20px; /* Position at the bottom */ bottom: 20px; /* Position at the bottom */
left: 20px; /* Position at the left */ left: 20px; /* Position at the left */
} }
.logo {
width: 80%; /* Adjust width for smaller screens */
max-width: 300px; /* Set a maximum width */
padding: 20px; /* Adjust padding */
margin: 10px auto; /* Adjust margin */
}
} }
/* Winkelmandje sectie */ /* Winkelmandje sectie */