Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file added background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions homework1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style1.css">
</head>
<body>
<div class="left-panel">
<h1>Welcome to Paint Quote System</h1>
<hr>
<p>
Consequat adipisicing ea do labore irure adipisicing occaecat cupidatat excepteur duis mo
</p>
</div>

<div class="right-panel">
<form action="submit" method="post">
<div>
<h2>Sign Up</h2>
<p class="title-line">Enter details to create your account</p>
</div>

<div>
<label for="username">Your name</label>
<input type="text" id="username" placeholder="Enter your name">
</div>

<div>
<label for="phone">Phone number</label>
<input type="text" id="phone" placeholder="Enter your phone number">
</div>

<div>
<label for="account">Dulux account</label>
<input type="text" id="account" placeholder="Enter your Dulux account">
</div>
Comment on lines +25 to +38

Choose a reason for hiding this comment

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

all the input elements miss name attribute, this is very important


<button class="preliminary-button">Sign up</button>

<p class="form-footer">
Already have an account?
<a href="login.html">Sign in</a>
</p>
</form>
</div>
</body>
</html>
110 changes: 110 additions & 0 deletions style1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}

body{
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
gap: 180px;
padding-left: 170px;
padding-right: 150px;

background-image: url("background.png");
background-size: cover;
background-repeat: no-repeat;
}

.left-panel{
flex: 1;
width: 100%;
Comment on lines +22 to +23

Choose a reason for hiding this comment

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

flex: 1 的作用是让子元素平分父容器的可用空间, width不需要设置

max-width: 460px;
margin-left: -40px;
margin-top: -35px;
Comment on lines +25 to +26

Choose a reason for hiding this comment

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

very bad practice to move the position of the left-section to the place you want, margin it is the distance between element, not to move an element

}

.left-panel h1{
font-size: 27px;
margin-bottom: 16px;
color: rgb(47, 74, 120);
}

.left-panel hr{
width: 100%;
max-width: 430px;
border: none;
border-top: 2px solid rgb(47, 74, 120);
margin: 12px 0 16px 0;
}

.left-panel p{
line-height: 1.7;
color: rgb(47, 74, 120);
}

.right-panel{
flex: 1;
width: 100%;
max-width: 500px;
flex-shrink: 0;
}

form{
width: 100%;
background-color: white;
padding: 30px 30px;
border-radius: 10px;
border: 1px solid #ddd;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

form h2 {
text-align: center;
}

.title-line{
text-align: center;
color: #777;
margin-bottom: 40px;
}

label{
display: block;
margin-top: 20px;
margin-bottom: 6px;
}

input{
display: block;
width: 100%;
padding: 14px 16px;
border: 1px solid #ccc;
border-radius: 6px;
}

.preliminary-button{
display: block;
width: 100%;
padding: 16px;
margin-top: 20px;
font-size: 18px;

background-color: #3f81b3;
color: #ffffff;

border: none;
border-radius: 6px;
}

.form-footer {
margin-top: 16px;
text-align: center;
font-size: 14px;
}

.form-footer a {
text-decoration: none;
}