页脚背景颜色消失,并且页脚文本在屏幕中间浮动

时间:2018-11-22 02:52:46

标签: html css flexbox

因此,在桌面上全屏显示时,您可以看到页脚很好,但是在调整为较窄的屏幕时,页脚的蓝色背景消失了,并且页脚的文本停留在屏幕中间。

我们正在为我学校的生物化学系创建此网页,并为此重新振奋。

html页面是学生奖,而css是主要奖项。内容在此repository中。

修改 jsfiddle

编辑2 ,这在jsfiddle中似乎可以正常使用,但在Windows 10 Chrome或Firefox中则无法使用。

  <!DOCTYPE html>
 <html lang="en">
<head>
    <link href="main.css" rel="stylesheet">
    <link href="awards.css" rel="stylesheet">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

</head>
<body>
    <header>
    </header>
    <div id="seperator"></div>
    <div id="content">
        <nav>
            <ul>
               <li><a href="index.html">Home</a></li>
                <li><a href="teaching.html">Teaching</a></li>
                <li><a href="research.html">Research</a></li>
                          <li><a href="publications.html">Publication</a></li>
                <li><a href="studentawards.html">Student Awards</a></li>
                <li><a href="gallery.html">Gallery</a></li>
                <li><a href="contact.html">Contact</a></li>
            </ul>
            <div id="sponsorLogo">
                <img id ="logo" src="resources/Acs.png" alt="ACS" height="30%" width="30%"><br><br>
                <img id ="logo" src="resources/nationalInstitudeofHealth.png" alt="ACS" height="30%" width="30%"><br><br>
                <img id ="logo" src="resources/Nsf.png" alt="ACS" height="30%" width="30%"><br><br>
                <img id ="logo" src="resources/Kbrin.png" alt="Kbrin" height="40%" width="40%"><br><br>
                <img id ="logo" src="resources/Cinsam.png" alt="ACS" height="80%" width="80%"><br><br>
                </div>
        </nav>
        <main>
            <!--THIS IS WHAT GETS CHANGED ON THE DIFFERENT PAGES-->
                <div class="awards">
                    <ul class="awardsItem">
                        <h3>KAS Undergraduate <br> Oral Presentation Competition</h3>
                        <hr class="horizontalRule">
                        <strong>2018: </strong><li>1st. Place Ayanav Roy</li>
                        <li>2nd. Place Quynh Nguyen</li>
                        <strong>2016: </strong><li>1st. Place Quynh Nguyen</li>
                        <strong>2015: </strong><li>1st. Place Alma Onate</li>
                        <strong>2014: </strong><li>3rd. Place Thuy Donna Do</li>
                        <strong>2013: </strong><li>1st. Place Thuy Donna Do</li>
                        <strong>2011: </strong><li>2nd. Place Adam McCallum</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>UR-STEM Summer Research Award</h3> <br>
                        <hr class="horizontalRule">
                        <strong>2018: </strong><li>Elizabeth Osifalujo</li>
                        <li>Kayla Laverne   </li>
                        <strong>2016: </strong><li>Andrew Quillen</li>
                        <li>Quynh Nguyen    </li>
                        <strong>2013: </strong><li>Emily Hogle</li>
                        <li>Janelle Tucker</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>NKU Dorothy Westerman Hermann <br> Undergraduate Research Award </h3>
                        <hr class="horizontalRule">
                        <strong>2018: </strong><li>Alex Rosen</li>
                        <strong>2017: </strong><li>Andrew Quillen</li>
                        <strong>2015: </strong><li>Alma Onate</li>
                        <strong>2014: </strong><li>Thuy Donna Do</li>
                        <strong>2013: </strong><li>Rebecca Kidney</li>
                        <strong>2012: </strong><li>Quintin Hauser</li>
                        <strong>2011: </strong><li>Eric Amato</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>ACS Undergraduate Award in <br> Organic Chemistry</h3>
                        <hr class="horizontalRule">
                        <strong>2016: </strong><li>Alma Onate</li>
                        <strong>2015: </strong><li>Thuy Donna Do</li>
                        <strong>2014: </strong><li>Timothy Dunn</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>Student Undergraduate <br> Research & Creative Awards (SURCA)</h3>
                        <hr class="horizontalRule">
                        <strong>2018: </strong><li>Quynh Nguyen</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>NKU Regents Award</h3> <br>
                        <hr class="horizontalRule">
                        <strong>2016: </strong><li>Alma Onate</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>NKU Greaves <br> Undergraduate Summer Research Award </h3>
                        <hr class="horizontalRule">
                        <strong>2018: </strong><li>Andrew Quillen</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>Cooper Research Excellence Scholarship</h3> <br>
                        <hr class="horizontalRule">
                        <strong>2018: </strong><li>Quynh Nguyen</li>
                        <strong>2015: </strong><li>Alma Onate</li>
                        <strong>2014: </strong><li>Thuy Donna Do</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>NKU Chemistry Department <br> Outstanding Senior Graduate</h3>
                        <hr class="horizontalRule">
                        <strong>2016: </strong><li>Alma Onate</li>
                        <strong>2015: </strong><li>Thuy Donna Do</li>
                        <strong>2014: </strong><li>Timothy Dunn</li>
                    </ul>

                    <ul class="awardsItem">
                        <h3>ACS Travel Award</h3>
                        <hr class="horizontalRule">
                        <strong>2011: </strong><li>Kevin Bonfield</li>
                    </ul>

                </div>
            <!--END OF WHAT CHANGES ON THE DIFFERENT PAGES-->
        </main>
        <div id="news">
            <a class="twitter-timeline" date-width="600" data-height="100%" data-theme="light" href="https://twitter.com/SatisfactoryAF?ref_src=twsrc%5Etfw">Tweets by SatisfactoryAF</a> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
        </div>
    </div>
    <div id="footer">
        <footer class="footer">
            &nbsp;&nbsp;&nbsp;&nbsp;Copyright &copy; Lili Ma, Ph.D.<br>
            &nbsp;&nbsp;&nbsp;&nbsp;Department of Chemistry & Biochemistry, Office SC 448<br>
            &nbsp;&nbsp;&nbsp;&nbsp;Northern Kentucky University at Highland Heights, KY 41099<br>
        </footer>
    </div>
</body>

任何帮助都将不胜感激,我几乎肯定这与flex-box有关,但是由于我的教练似乎对我不太了解,所以我有点在黑暗中射击。

任何帮助都将得到申请。

我访问过的资源:

  • https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/
  • https://stackoverflow.com/questions/50429737/sticky-footer-with-flexbox
  • https://stackoverflow.com/questions/30202294/flexbox-wraps-outside-of-container
  • https://codepen.io/noahblon/post/practical-guide-to-flexbox-dont-forget-about-flex-shrink

以上似乎都不满足我的需求

1 个答案:

答案 0 :(得分:1)

 <div id="content" style="height: auto;"> replace <div id="content">

in studentawards.html