测试浮动导航栏旁边而不是

时间:2017-03-15 06:26:44

标签: jquery html ios css

我试图创建一个“汉堡包菜单”,但每次我输入图片时,它都会在导航旁边而不是在div之上。所以我用文本测试了它,它仍然漂浮在导航旁边。我研究了这个并找不到答案。我试图让它漂浮而不是导航栏旁边。 Html将在这里发布,其余的将在codepen中。

演示: http://codepen.io/anon/pen/LWjaYV

HTML

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link href="https://fonts.googleapis.com/css?family=Nunito:700" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Baloo" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
        <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> 

             <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
        <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>


        <link rel="stylesheet" type="text/css" href="magicstyle.css">

        </head>     
        <body>
            <!-- Section for Jobs Popup -->
                 <div id="job-popup">
            <div class="x-div1"><img class="x-icon1" id="fadeX1" src="Pictures/web%20x%20icon%20white.png" alt="Text alternative when image is not available"></div>
            <div id="job-content">

                <h1 id="jobWords"></h1>

                </div>

            </div>
            <!-- Section for Contact Popup -->
            <div id="contact-popup">
            <div class="x-div2"><img class="x-icon2" id="fadeX2" src="Pictures/web%20x%20icon%20white.png"></div>
            <div id="contact-content">

                <h1 id="contactWords"></h1>

                </div>

            </div>

            <!-- Section for Press Popu -->
             <div id="press-popup">
            <div class="x-div3"><img class="x-icon3" id="fadeX3" src="Pictures/web%20x%20icon%20white.png"></div>
            <div id="press-content">

                <h1 id="pressWords"></h1>

                </div>

            </div>

            <div id="legal-popup">
            <div class="x-div4"><img class="x-icon4" id="fadeX4" src="Pictures/web%20x%20icon%20white.png"></div>
            <div id="legal-content">

                <h1 id="legalWords"></h1>

                </div>

            </div>

            <div id="support-popup">
            <div class="x-div5"><img class="x-icon5" id="fadeX5" src="Pictures/web%20x%20icon%20white.png"></div>
            <div id="support-content">

                <h1 id="supportWords"></h1>

                </div>

            </div>



                <div id="top-bar">

                        <a class="burger-nav"></a>
                    <p id="testText">dkdd</p>
                    <div id="nav-menu">
                    <span id="job">Jobs</span>
                    <span id="contact">Contact</span>
                    <span id="press">Press</span>
                    <span id="legal">Legal</span>
                    <span id="support">Support</span>

                    </div>


                </div>
            <div id="container">


                <div id="name-div">
                <h1 id="name">Open Touch</h1>
                </div>
                <ul class="bubbles">

            <li id="firstCircle"></li>
            <li id="secondCircle"></li>
            <li id="thirdCircle"></li>
            <li id="fourthCircle"></li>
            <li id="fifthCircle"></li>
            <li id="sixthCircle"></li>



            </ul>



            </div>



        </body>





</html>

任何类型的帮助将不胜感激

2 个答案:

答案 0 :(得分:0)

抱歉,我已添加到<div id="name-div" style="position: relative; top: 21px;">。问题是我对你想要实现的目标没有明确的想法

这是我的截图。如果我把这个文本更多一些(top:你可以去负),就会出现一些溢出问题。我不知道我们是否应该修复它。所以让我知道

由于 enter image description here

答案 1 :(得分:-1)

嗯,我通过将“min-height:0”应用到“顶栏”来解决它,这似乎解决了它。现在,当我添加更多文本时,div会调整文本,而不是让它溢出来。