Skip to content

HTML CSS Module Project #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
317 changes: 317 additions & 0 deletions css/store.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,317 @@
header {
height: 100px;
display: flex;
justify-content: space-between;
position: relative;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you already learn the differences between position static, relative, absolute, etc?
Why do you need relative in this case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"I used position: relative on the header because I want to reposition the navigation when applying media queries for mobile devices. On mobile, the navigation (header nav) is set to position: absolute, allowing me to control its position using the top, bottom, left, and right properties. By setting the parent (header) to position: relative, I ensure that the absolutely positioned navigation is placed relative to the header, making it easier to position the nav exactly where needed for mobile layouts."

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Nice one

}
.burger-button {
display: none;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it hidden? Just work in progress? Or it's not needed for this design?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice Question!
"The burger button is hidden because it's unnecessary when the page is displayed in the web view (for larger screens). I activate the burger button for mobile displays using media queries. This way, it's only visible and usable when the page is viewed on a mobile device."

font-size: 30px;
cursor: pointer;
margin-left: auto;
}
header img {
width: 70px;
height: 50px;
padding: 15px;
margin-left: 2rem;
}
.nav-header {
display: flex;
gap: 10px;
align-items: center;
margin-right: 2rem;
}
a {
text-decoration: none;
color: rgb(129, 121, 121);
}

a:hover {
color: rgba(240, 81, 18, 0.904);
font-weight: bold;
}

.nav-header .active {
font-weight: bold;
color: rgb(85, 81, 81);
}
.nav-header .active:hover {
color: rgba(240, 81, 18, 0.904);
}

.container {
display: flex;
}
.element1 {
width: 50%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.element2 {
width: 50%;
height: 100%;
}
.element2 img {
width: 100%;
height: 100%;
object-fit: cover;
}
h1 {
text-align: center;
font-size: 50px;
padding: 30px;
margin-top: 3rem;
color: rgba(240, 81, 18, 0.904);
}
form {
width: 80%;
height: auto;
}
.form {
margin-top: 1rem;
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
margin-bottom: 1rem;
}
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
}
.form-address {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
input[type="text"],
select {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 10px;
box-sizing: border-box;
}
.address {
margin-top: 1rem;
width: 64%;
}
.input-group {
width: 31%;
}
.radio-group {
width: 66%;
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
margin-left: 10px;
}
.radio {
gap: 7px;
display: flex;
}
legend {
margin-left: 8rem;
font-weight: bold;
margin-top: 10px;
padding: 10px;
margin-bottom: 10px;
}
.checkbox {
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
gap: 12px;
margin-top: 7rem;
margin-bottom: 10px;
width: 350px;
margin-left: 7rem;
}
.checkbox label span {
text-decoration: underline;
color: rgba(240, 81, 18, 0.904);
}
button {
margin-top: 1rem;
background-color: rgba(240, 81, 18, 0.904);
border-color: rgba(240, 81, 18, 0.904);
padding: 10px;
width: 200px;
text-decoration: none;
font-size: 1.2rem;
color: white;
}
button:hover {
transform: scale(1.05);
}
.button_div {
margin-left: 9rem;
}
.fot img {
width: 20px;
}
footer {
margin-top: 5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 20px;
}

footer :nth-child(1) {
font-weight: bold;
font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
font-size: 20px;
}

a {
padding: 20px;
}

footer :nth-child(3) {
color: rgb(177, 173, 173);
}
@media (max-width: 900px) {
h1 {
margin-top: 1rem;
font-size: 18px;
}
.form {
margin-top: 0.3rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 10px;
margin-bottom: 0.5rem;
}

.input-group {
width: 80%;
}
.address {
margin-top: 0.3rem;
width: 80%;
}

legend {
margin-left: 1.5rem;
margin-bottom: 10px;
}
.radio-group {
display: flex;
flex-direction: column;
margin-left: 10px;
}

.radio {
padding: 10px;
width: 150px;
}
}
@media (max-width: 768px) {
header {
align-items: center;
height: auto;
padding: 20px;
}

header :nth-child(2) {
flex-direction: column;
gap: 10px;
margin-left: 0;
}
header img {
width: 50px;
height: 40px;
padding: 15px;
margin-left: 1rem;
}
.burger-button {
display: block;
}
.form {
margin-top: 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 10px;
margin-bottom: 0.5rem;
}
.input-group {
width: 80%;
}
.address {
margin-top: 0.5rem;
width: 80%;
}
legend {
margin-left: 2rem;
margin-bottom: 10px;
}
h1 {
font-size: 20px;
}
.checkbox {
margin-left: 2rem;
width: 200px;
}
.button_div {
margin-left: 3rem;
}
.radio-group {
display: flex;
flex-direction: column;
margin-left: 10px;
}
.radio {
padding: 10px;
width: 150px;
}
.container {
display: flex;
flex-direction: column;
}
.element1 {
width: 100%;
height: auto;
display: flex;
flex-direction: column;
align-items: center;
}
.element2 {
margin-top: 3rem;
height: auto;
width: 100%;
}
.nav-header {
display: none;
width: 100vw;
height: 100vh;
flex-direction: column;
gap: 10px;
right: 0;
left: 0;
position: absolute;
top: 100%;
z-index: 10;
background: white;
}

.nav-header.active {
display: flex;
}

header :nth-child(2) {
margin-left: 0;
}
}
Loading