freeCodeCamp | Product Landing Page

展示图

freeCodeCamp | Product Landing Page_第1张图片
freeCodeCamp | Product Landing Page_第2张图片

HTML代码

DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="../css/Product_Landing_Page.css">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
          integrity="sha384-50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf" crossorigin="anonymous">
    <title>Titletitle>
head>
<body>
<div id="page-wrapper">
    <header id="header">
        <div class="logo">
            <img id="header-img"
                 src="https://cdn.freecodecamp.org/testable-projects-fcc/images/product-landing-page-logo.png"
                 alt="original trombones logo">
        div>
        <nav id="nav-bar">
            <ul>
                <li>
                    <a class="nav-link" href="#features">Featuresa>
                li>
                <li>
                    <a class="nav-link" href="#how-it-works">How It Worksa>
                li>
                <li>
                    <a class="nav-link" href="#pricing">Pricinga>
                li>
            ul>
        nav>
    header>
    <section id="hero">
        <h2>Handcrafted, home-made masterpiecesh2>
        <form id="form" action="https://www.freecodecamp.com/email-submit">
            <input id="email" name="email" type="email" placeholder="Enter your email address" required/>
            <input id="submit" type="submit" value="GET STARTED" class="btn">
        form>
    section>
    <div class="container">
        <section id="features">
            <div class="grid">
                <div class="icon">
                    <i class="fa fa-3x fa-fire">i>
                div>
                <div class="desc">
                    <h2>Premium Materialsh2>
                    <p>
                        Our trombones use the shiniest brass which is sourced locally.
                        This will increase the longevity of your purchase.
                    p>
                div>
            div>
            <div class="grid">
                <div class="icon"><i class="fa fa-3x fa-truck">i>div>
                <div class="desc">
                    <h2>Fast Shippingh2>
                    <p>
                        We make sure you receive your trombone as soon as we have
                        finished making it. We also provide free returns if you are not
                        satisfied.
                    p>
                div>
            div>
            <div class="grid">
                <div class="icon">
                    <i class="fa fa-3x fa-battery-full" aria-hidden="true">i>
                div>
                <div class="desc">
                    <h2>Quality Assuranceh2>
                    <p>
                        For every purchase you make, we will ensure there are no damages
                        or faults and we will check and test the pitch of your
                        instrument.
                    p>
                div>
            div>
        section>
        <section id="how-it-works">
            <iframe id="video" height="315"
                    src="https://www.youtube-nocookie.com/embed/y8Yv4pnO7qc?rel=0&controls=0&showinfo=0"
                    frameborder="0" allowfullscreen="">iframe>
        section>
        <section id="pricing">
            <div class="product" id="tenor">
                <div class="level">Tenor Trombonediv>
                <h2>$600h2>
                <ol>
                    <li>Lorem ipsum.li>
                    <li>Lorem ipsum.li>
                    <li>Lorem ipsum dolor.li>
                    <li>Lorem ipsum.li>
                ol>
                <button class="btn">Selectbutton>
            div>
            <div class="product" id="bass">
                <div class="level">Bass Trombonediv>
                <h2>$900h2>
                <ol>
                    <li>Lorem ipsum.li>
                    <li>Lorem ipsum.li>
                    <li>Lorem ipsum dolor.li>
                    <li>Lorem ipsum.li>
                ol>
                <button class="btn">Selectbutton>
            div>
            <div class="product" id="valve">
                <div class="level">Valve Trombonediv>
                <h2>$1200h2>
                <ol>
                    <li>Plays similar to a Trumpetli>
                    <li>Great for Jazz Bandsli>
                    <li>Lorem ipsum dolor.li>
                    <li>Lorem ipsum.li>
                ol>
                <button class="btn">Selectbutton>
            div>
        section>
        <footer>
            <ul>
                <li><a href="#">Privacya>li>
                <li><a href="#">Termsa>li>
                <li><a href="#">Contacta>li>
            ul>
            <span>Copyright 2016, Original Trombonesspan>
        footer>
    div>
div>
body>
html>

CSS代码

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #eee;
    font-family: Cambria, sans-serif;
}

#page-wrapper {
    position: relative;
}

header {
    background-color: #eee;
    position: fixed;
    top: 0;
    min-height: 75px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

@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;
}

nav > ul {
    width: 35vw;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
}

li {
    list-style: none;
}

a {
    color: #000;
    text-decoration: none;
}

#hero {
    height: 200px;
    margin-top: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#hero > h2 {
    margin-bottom: 20px;
    word-wrap: break-word;
}

#hero input[type="email"] {
    max-width: 275px;
    width: 100%;
    padding: 5px;
}

#hero input[type="submit"] {
    background-color: #f1c40f;
    max-width: 150px;
    width: 100%;
    height: 30px;
    margin: 15px 0;
    border: 0;
}

.btn {
    padding: 0 20px;
    height: 40px;
    font-size: 1em;
    font-weight: 900;
    text-transform: uppercase;
    border: 3px black solid;
    background: transparent;
    cursor: pointer;
}

.container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
}

#features {
    margin-top: 30px;
}

.grid {
    display: flex;
}

#features .icon {
    color: darkorange;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 125px;
    width: 20vw;
}

#features .desc {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 125px;
    width: 80vw;
    padding: 5px;
}

#how-it-works {
    margin-top: 50px;
    display: flex;
    justify-content: center;
}

#how-it-works > iframe {
    max-width: 560px;
    width: 100%;
}

#pricing {
    margin-top: 60px;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.product {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: calc(100% / 3);
    margin: 10px;
    border: 1px solid #000;
    border-radius: 3px;
}

.product > .level {
    color: black;
    background-color: #ddd;
    padding: 15px 0;
    width: 100%;
    text-transform: uppercase;
    font-weight: 700;
}

.product > h2 {
    margin-top: 15px;
}

.product > ol {
    margin-top: 15px;
}

.product > ol > li {
    padding: 5px 0;
}

.product > button {
    border: 0;
    background-color: #f1c40f;
    margin: 15px 0;
    font-weight: 400;
}

footer {
    margin-top: 30px;
    background-color: #ddd;
    padding: 20px;
}

footer > ul {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
}

footer > ul > li {
    padding: 0 10px;
}

footer > span {
    color: #444;
    display: flex;
    justify-content: flex-end;
    font-size: 0.9em;
    margin-top: 5px;
}

有错误请各位批评指正,欢迎大家一起交流学习。如果大家觉得有所帮助,点赞支持下吧谢谢!

你可能感兴趣的:(css,html,前端)