freeCodeCamp —- Responsive Web Dedign
Product Landing Page —— Test
Objective:
Build an app that is functionally similar to https://product-landing-page.freecodecamp.rocks
User Stories:
- Your product landing page should have a
header
element with a corresponding id="header"
- You can see an image within the
header
element with a corresponding id="header-img"
(A logo would make a good image here)
- Within the
#header
element, you can see a nav
element with a corresponding id="nav-bar"
- You can see at least three clickable elements inside the
nav
element, each with the class nav-link
- When you click a
.nav-link
button in the nav
element, you are taken to the corresponding section of the landing page
- You can watch an embedded product video with
id="video"
- Your landing page has a
form
element with a corresponding id="form"
- Within the form, there is an
input
field with id="email"
where you can enter an email address
- The
#email
input field should have placeholder text to let users know what the field is for
- The
#email
input field uses HTML5 validation to confirm that the entered text is an email address
- Within the form, there is a submit
input
with a corresponding id="submit"
- When you click the
#submit
element, the email is submitted to a static page (use this mock URL: https://www.freecodecamp.com/email-submit
)
- The navbar should always be at the top of the viewport
- Your product landing page should have at least one media query
- Your product landing page should utilize CSS flexbox at least once
Fulfill the user stories and pass all the tests below to complete this project. Give it your own personal style. Happy Coding!
Note: Be sure to add <link rel="stylesheet" href="styles.css">
in your HTML to link your stylesheet and apply your CSS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| <!DOCTYPE html> <html lang="en"> <head> <link rel="stylesheet" href="styles.css"> </head> <body> <main> <header id="header"> <div class="logo"> <img id="header-img" src="https://cdn.freecodecamp.org/testable-projects-fcc/images/product-landing-page-logo.png" /> </div> <nav id="nav-bar"> <ul> <li> <a href="#feature" class="nav-link">特征</a> </li> <li> <a href="#work" class="nav-link">工作原理</a> </li> <li> <a href="#feature" class="nav-link">定价</a> </li> </ul> </nav> </header> <section> <h2>Handcrafted, home-made masterpieces</h2> <form id="form" action="https://www.freecodecamp.com/email-submit"> <input type="email" id="email" placeholder="请输入你的邮箱" name="email"/> <input type="submit" id="submit"> </form> </section> <section id="feature"> <div> <div class="icon"></div> <div class="desc">aa</div> </div> <div> <div class="icon"></div> <div class="desc">bb</div> </div> <div> <div class="icon"></div> <div class="desc">cc</div> </div> </section> <section id="work"> <video id="video" src=""></video> </section> </main> </body> </html>
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
| @import 'https://fonts.googleapis.com/css?family=Lato:400,700'; * { margin: 0; padding: 0; box-sizing: border-box; }
body { background-color: #eee; font-family: 'Lato', sans-serif; } main{ position: relative; }
header{ position: fixed; top: 0; min-height: 75px; padding: 0px 20px; display: flex; justify-content: space-around; align-items: center; background-color: #eee; } @media (max-width: 600px) { header { flex-wrap: wrap; } } .logo { width: 60vw; }
@media (max-width: 650px) { .logo { margin-top: 15px; width: 100%; position: relative; } }
.logo > img { width: 100%; height: 100%; max-width: 300px; display: flex; justify-content: center; align-items: center; text-align: center; margin-left: 20px; }
@media (max-width: 650px) { .logo > img { margin: 0 auto; } }
nav { font-weight: 400; } @media (max-width: 650px) { nav { margin-top: 10px; width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 50px; } nav li { padding-bottom: 5px; } } nav > ul { width: 35vw; display: flex; flex-direction: row; justify-content: space-around; }
@media (max-width: 650px) { nav > ul { flex-direction: column; } } li { list-style: none; } a { color: #000; text-decoration: none; }
|