1

在此处输入图像描述这是我为 index.html 或主页编写的 html 代码。我已经使用 sass 代码将其编译到 css 中。我尝试了我在互联网上可以找到的所有与如何摆脱空白相关的东西,但没有任何帮助,我不想使用粘性页脚或将其位置设置为固定。

    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="UTF-8" />
            <link
                rel="stylesheet"
                href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
                integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
                crossorigin="anonymous"
            />

            <link
                href="https://fonts.googleapis.com/css?family=Dosis&display=swap"
                rel="stylesheet"
            />

            <link rel="stylesheet" href="css/main.css" />

            <title>John | UI/UX Designer & Photographer</title>
        </head>
        <body>
            <!--header--> 
            <header id="header-home">
                <div class="container">
                    <nav id="main-nav">
                        <h2><a href="home.html">the deck</a></h2>
                        <ul>
                            <li><a href="index.html" class="current">Home</a></li>
                            <li><a href="About.html">About</a></li>
                            <li><a href="Work.html">Work</a></li>
                            <li><a href="contact.html">Contact Us</a></li>
                        </ul>
                    </nav>
                    <div class="header-content">
                        <h1>
                            I am John The
                            <span
                                class="txt-type"
                                data-wait="3000"
                                data-words='["Photographer", "Designer", "UI/UX Developer"]'
                            ></span>
                        </h1>
                        <p class="lead">I specialize in UI and Photography</p>
                        <a href="work.html" class="btn-light">View My Work</a>
                    </div>
                </div>
            </header>
    //These all the contents of the html page divided everything into sections A,B,C...respectively.
            <!--SECTION A SPECIALIZE -->
            <section id="home-a" class="text-center py-2">
                <div class="container">
                    <h2 class="section-title">I SPECIALIZE IN</h2>
                    <div class="bottom-line"></div>
                    <p class="lead">
                        Photography as well as creating digital masterpieces and UI/UX layouts
                        for websites and mobile applications
                    </p>

                    <div class="specials">
                        <div>
                            <i class="fas fa-file-alt fa-2x"></i>
                            <h3>Concepting</h3>
                            <p>
                                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet
                                beatae, omnis ipsa voluptates labore aperiam placeat, nostrum
                                nulla alias dignissimos?
                            </p>
                        </div>
                        <div>
                            <i class="fas fa-desktop fa-2x"></i>
                            <h3>UI/UX</h3>
                            <p>
                                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet
                                beatae, omnis ipsa voluptates labore aperiam placeat, nostrum
                                nulla alias dignissimos?
                            </p>
                        </div>
                        <div>
                            <i class="fas fa-object-ungroup fa-2x"></i>
                            <h3>VISUAL DESIGN</h3>
                            <p>
                                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet
                                beatae, omnis ipsa voluptates labore aperiam placeat, nostrum
                                nulla alias dignissimos?
                            </p>
                        </div>
                        <div>
                            <i class="fas fa-thumbs-up fa-2x"></i>
                            <h3>INTERACTION</h3>
                            <p>
                                Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet
                                beatae, omnis ipsa voluptates labore aperiam placeat, nostrum
                                nulla alias dignissimos?
                            </p>
                        </div>
                    </div>
                </div>
            </section>

            <!--SECTION B STATS-->
            <section id="home-b" class="text-center py-2">
                <div class="stats">
                    <div>
                        <ul>
                            <li><i class="fas fa-users fa-3x"></i></li>
                            <li class="stats-title">Clients</li>
                            <li class="stats-numbers">100</li>
                        </ul>
                    </div>
                    <div>
                        <ul>
                            <li><i class="fas fa-award fa-3x"></i></li>
                            <li class="stats-title">Awards</li>
                            <li class="stats-numbers">3</li>
                        </ul>
                    </div>
                    <div>
                        <ul>
                            <li><i class="fas fa-hourglass-start fa-3x"></i></li>
                            <li class="stats-title">Hours Worked</li>
                            <li class="stats-numbers">3500</li>
                        </ul>
                    </div>
                    <div>
                        <ul>
                            <li><i class="fas fa-code-branch fa-3x"></i></li>
                            <li class="stats-title">Projects Completed</li>
                            <li class="stats-numbers">100</li>
                        </ul>
                    </div>
                </div>
            </section>
                <!-- SECTION C MY CREATIVE PROCESS -->
                <section id="home-c" class="text-center py-2">
                    <div class="container">
                        <h2 class="section-title">
                            MY CREATIVE PROCESS
                        </h2><div class="bottom-line"></div>
                        <p class="lead">All of my UI/UX and design projects are based off of a practiced                                                                 
                         formula to get the result that I am looking for

                        </p>
                        <div class="process">
                            <div>
                                <i class="fas fa-file-alt fa-4x process-icon my-2">
                                    <div class="process-step">1</div>
                                </i>
                                <div class="clear"></div>
                                <h3>DISCUSS THE PROJECT
                                </h3>
                                Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quasi voluptate 
                                 earum quaerat itaque officia soluta?
                            </div>
                            <div>
                                <i class="fas fa-desktop fa-4x process-icon my-2">
                                    <div class="process-step">2</div>
                                </i>
                                <div class="clear"></div>
                                <h3>BRAINSTORMING ^ CONCEPT

                                </h3>
                                Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quasi voluptate 
                                earum quaerat itaque officia soluta?
                            </div>
                            <div>
                                <i class="fas fa-object-ungroup fa-4x process-icon my-2">
                                    <div class="process-step">3</div>
                                </i>
                                <div class="clear"></div>
                                <h3>UI/UX PLANNING

                                </h3>
                                Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quasi voluptate 
                                earum quaerat itaque officia soluta?
                            </div>
                            <div>
                                <i class="fas fa-thumbs-up fa-4x process-icon my-2">
                                    <div class="process-step">4</div>
                                </i>
                                <div class="clear"></div>
                                <h3>INTERACTION
                                </h3>
                                Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quasi voluptate 
                                earum quaerat itaque officia soluta?
                            </div>

                        </div>
                    </div>
                </section>
            </div>

                <!-- FOOTER -->
                <footer id="main-footer">
                    <div class="footer-content container">
                        <p>Copyright © 2019. All Rights Reserved

                        </p>
                        <div class="social">
                            <i class="fab fa-twitter"></i>
                            <i class="fab fa-facebook"></i>
                            <i class="fab fa-instagram"></i>
                            <i class="fab fa-linkedin"></i>
                        </div>
                    </div>
                </footer>

            <script src="js/typewriter.js"></script>
        </body>
    </html>

我在制作这个网站时使用了 sass,与它相关的所有代码都在这里。

    @import "config";
    @import "utilities";
    @import "item_grid";

    //GENERAL STYLES
    * {
        margin: 0;
        padding: 0;
    }

    #main {
        height: 100%;
    }
    body {
        flex-direction: column;

        margin: 0;
        font-family: "Dosis", sans-serif;
        line-height: 1.6;
    }

    a {
        text-decoration: none;
        color: $dark-color;
    }

    ul {
        list-style: none;
    }

    h2,
    h3,
    h4 {
        text-transform: uppercase;
    }

    img {
        width: 100%;
    }

    //LOGO
    #logo {
        width: 70px;
        height: 70px;
        color: #fff;
        text-transform: uppercase;
    }

    //MAIN NAV
    #main-nav {
        display: flex;
        justify-content: space-between;
        padding-top: 1rem;

        ul {
            display: flex;
        }

        li {
            padding: 1rem 1.5rem;
        }

        a {
            text-decoration: none;
            color: #fff;
            text-transform: uppercase;
            border-bottom: 3px transparent solid;
            padding-bottom: 0.5rem;
            transition: border-color 0.5s;

            &:hover {
                border-color: $medium-color;
            }

            &.current {
                border-color: $main-color;
            }
        }
    }

    //HEADER
    #header {
        //HEADER HOME WHOLE
        &-home {
            background: $bg-image no-repeat center right / cover;
            color: #fff;

            //HEADER CONTENT
            .header-content {
                padding-top: 20%;
                text-align: center;

                h1 {
                    font-size: 4rem;
                    line-height: 1.2;
                }
            }
        }
        // HEADER INNER PAGES CONTENT
        &-inner {
            background: $bg-image no-repeat 20% 30% / cover;
            height: 5.5rem;
            border-bottom: 3px solid $main-color;
        }
    }

    //HOME SECTIONS
    #home {
        //HOME SECTION A

        &-a {
            padding-top: 100px;
            width: 100%;
            height: 20rem;

            .container {
                padding-left: 0;
                padding-right: 0;
            }

            .specials {
                margin-top: 1rem 0;
                display: grid;
                grid-gap: 1rem;
                grid-template-columns: repeat(4, 1fr);

                .fas {
                    color: $main-color;
                    padding-bottom: 0.8rem;
                }
            }
        }

        //HOME SECTION B

        &-b {
            height: 300px;

            .container {
                height: 100%;
                padding: 0;
                margin: 0;
            }

            .stats {
                height: 100%;
                display: grid;
                grid-template-columns: repeat(4, 1fr);

                li {
                    padding-top: 2rem;
                    line-height: 1;

                    &.stats-title {
                        font-size: 2rem;
                        font-weight: bold;
                    }

                    &.stats-numbers {
                        font-size: 1.5rem;
                        font-weight: bold;
                    }
                }

                div {
                    padding: 2rem 0;
                    margin: 0;

                    &:nth-child(odd) {
                        background: $light-color;
                    }

                    &:nth-child(even) {
                        background: $medium-color;
                    }
                }
            }
        }

        &-c {
            margin-top: 50px;
            height: 500px;
            .container {
                padding-left: 0;
                padding-right: 0;
            }

            .process {
                display: grid;
                grid-gap: 3rem;
                grid-template-columns: repeat(4, 1fr);
                text-align: center;

                &-step {
                    position: absolute;
                    top: 0;
                    right: 0;
                    font-size: 28px;
                    background: $main-color;
                    border-radius: 50%;
                    height: 15px;
                    width: 15px;
                    line-height: 15px;
                    padding: 1rem;
                    transition: all 1s;
                }
                //PROCESS ICON
                &-icon {
                    border-radius: 50%;
                    background: $dark-color;
                    color: #fff;
                    padding: 2rem;
                    width: 70px;
                    height: 70px;
                    line-height: 70px;
                    text-align: center;
                    position: relative;
                    transition: all 1s;

                    &:hover {
                        background: $main-color;
                        width: 90px;
                        height: 90px;
                        line-height: 90px;

                        .process-step {
                            background: $dark-color;
                        }
                    }
                }
            }
        }
    }


    // FOOTER

    #main-footer {

        background: $dark-color;
        color: #fff;
        height: 6rem;

        .footer-content {
            display: flex;
            justify-content: space-between;
            height: 6rem;
            align-items: center;
        }

        .social .fab {
            margin: 1rem;
            border: 2px #fff solid;
            border-radius: 50%;
            height: 20px;
            width: 20px;
            line-height: 20px;
            text-align: center;
            padding: 0.5rem;

            &:hover {
                background: $main-color;
            }
        }
    }

config.scss 代码


    //VARIABLES
    $website-width:1280px;
    $main-color:#ffbc00;
    $light-color: #f4f4f4;
    $medium-color:#ccc;
    $dark-color:#333;
    $bg-image:url('../images/main.jpg');

//SET TEXT COLOR FUNCTION 

    @function set-text-color($color) {
    @if(lightness($color) > 50 ) {
        @return #000 ;
    }
    @else {
        @return #fff;
    }
    }

实用程序.scss 代码:

    .container {
    max-width: $website-width;
    height: 100vh;
    padding: 0 350px;
    margin: auto;
    overflow: hidden;
    }

//BUTTONS
    %btn-shared {
    display: inline-block;
    padding: 0.8rem 2rem;
    transition: all 0.5s;
    border: none;
    cursor: pointer;
    }

    .btn {

    &-main {
        @extend %btn-shared;
        color: #333;
        background-color: $main-color;
    }

    &-light {
        @extend %btn-shared;
        color: #333;
        background-color: $light-color;
    }

    &-dark {
        @extend %btn-shared;
        color: #f4f4f4;
        background-color: $dark-color;
    }
    }

    button[class^='btn-']:hover,
    a[class^='btn-']:hover,
    input[class^='btn-']:hover {
    background-color: $main-color;
    }

// ABOUT BACKGROUNDS 
    .bg {
    &-main {
        background: $main-color;
        color: set-text-color($main-color);
    }
    &-dark {
        background: $dark-color;
        color: set-text-color($dark-color);
    }
    &-light {
        background: $light-color;
        color: set-text-color($light-color);
    }
    &-medium {
        background: $medium-color;
        color: set-text-color($medium-color);
    }
    }

    .lead {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    }

    .text-center {
    text-align: center;
    }

//PADDING 
    .py {
    &-1 {
        padding: 1rem 0;
    }
    &-2 {
        padding: 2rem 0;
    }
    &-3 {
        padding: 3rem 0;
    }
    &-4 {
        padding: 4rem 0;
    }
    }


//MARGIN 
    .my {
    &-1 {
        margin: 1rem 0;
    }
    &-2 {
        margin: 2rem 0;
    }
    &-1 {
        margin: 3rem 0;
    }
    &-1 {
        margin: 4rem 0;
    }
}


.section-title {
    font-size: 2rem ;
    display: block;
    padding-bottom: 0.5rem;
    text-align: center;
    font-weight: 100;
    text-transform: uppercase;
    }

    .bottom-line {
    height: 2px;
    width: 3rem;
    background: $main-color;
    display: block;
    margin: 0 auto 1rem auto;
    }

与 item_grid.scss 相关的代码与该页面完全无关。感谢您的帮助。

4

1 回答 1

0

你试过这个:

.footer {
   position: fixed;
   left: 0;
   bottom: 0;
   width: 100%;
}
于 2020-05-01T20:21:38.833 回答