所有元素都在导航栏下方

如何解决所有元素都在导航栏下方

For Image of the problem Click Here

这是我的html代码

<!DOCTYPE html>
<html lang="en" >
<head>
  <meta charset="UTF-8">
  <title>Smileybook</title>
  <meta name="viewport" content="width=device-width,initial-scale=1">

<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700,900&display=swap" rel="stylesheet">

<link href="buttonstyle.css" rel="stylesheet">


<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css">
<link rel="stylesheet" href="./style.css">



<style>
div {
  margin-bottom: ;
  padding: ;
}

.danger {
  background-color: #ffdddd;
  border-left: 6px solid #f44336;
}

.success {
  background-color: #ddffdd;
  border-left: 6px solid #4CAF50;
}

.info {
 margin-top:  ;
 background-color: #e7f3fe;
 border-left: 6px solid #2196F3;
 border-radius: 5px;
 transition: opacity 1s;
}

.warning {
  background-color: #ffffcc;
  border-left: 6px solid #ffeb3b;
}
.closebtn {
  margin-left: 5px;
  color: black;
  font-weight: bold;
  float: right;
  font-size: 22px;
  line-height: 30px;
  cursor: pointer;
  transition: 0.5s;
}

.closebtn:hover {
  color: black;
}
</style>

<style>
/* width */
::-webkit-scrollbar {
  width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
  box-shadow: inset 0 0 5px grey;
  border-radius: 100px;
}

/* Handle */
::-webkit-scrollbar-thumb {
  background: #50D3C9;
  border-radius: 100px;
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
  background: #50D3C9;
}
</style>


<style>
.buttonhover {
  border-radius: 40px;
  background-image: linear-gradient(90deg,rgb(2,200) 0%,rgb(9,9,121) 0%,rgb(0,212,255) 100%);;
  border: solid;
  color: #FFFFFF;
  text-align: center;
  font-size: 13px;
  padding: 14px;
  width: 135px;
  transition: all 0.5s;
  cursor: pointer;
  margin-top: 5px;
  margin-bottom: 5px;
}

.buttonhover span {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: 0.5s;
}

.buttonhover span:after {
  content: '\00bb';
  position: absolute;
  opacity: 0;
  top: 0;
  right: -20px;
  transition: 0.5s;
}

.buttonhover:hover span {
  padding-right: 25px;
}

.buttonhover:hover span:after {
  opacity: 1;
  right: 0;
}
</style>

<style>
/* Full-width input fields */
input[type=text],input[type=password] {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Set a style for all buttons */
button {
    background-color: #2FEA14;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    cursor: pointer;
    width: 100%;
}

button:hover {
    opacity: 0.8;
}

/* Extra styles for the cancel button */
.cancelbtn {
    width: auto;
    padding: 10px 18px;
    background-color: #FFF300;
}

/* Center the image and position the close button */
.imgcontainer {
    text-align: center;
    margin: 24px 0 12px 0;
    position: relative;
}

img.avatar {
    width: 40%;
    border-radius: 50%;
}

.container {
    padding: 16px;
}

span.psw {
    float: right;
    padding-top: 16px;
}

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: manual; /* Enable scroll if needed */
    background-color: rgb(0,0); /* Fallback color */
    background-color: rgba(0,0.4); /* Black w/ opacity */
    padding-top: 60px;
}

/* Modal Content/Box */
.modal-content {
    background-color: #fefefe;
    margin: 5% auto 15% auto; /* 5% from the top,15% from the bottom and centered */
    border: 1px solid #888;
  border-radius: 5px ; width: 80%; /* Could be more or less,depending on screen size */
}

/* The Close Button (x) */
.close {
    position: absolute;
    right: 3%;
    top: 0;
    color: #000;
    font-size: 35px;
    font-weight: bold;
}

.close:hover,.close:focus {
    color: red;
    cursor: pointer;
}

/* Add Zoom Animation */
.animate {
    -webkit-animation: animatezoom 0.6s;
    animation: animatezoom 0.6s
}

@-webkit-keyframes animatezoom {
    from {-webkit-transform: scale(0)}
    to {-webkit-transform: scale(1)}
}

@keyframes animatezoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

/* Change styles for span and cancel button on extra small screens */
@media screen and (max-width: 300px) {
    span.psw {
       display: block;
       float: none;
    }
    .cancelbtn {
       width: 100%;
    }
}
</style>

</head>

</div>





<ul id="nav-1">
    <li class="slide1"></li>
    <li class="slide2"></li>
    <li><a href="#">Alpha</a></li>
    <li><a href="#">Beta</a></li>
    <li><a href="#">Gamma</a></li>
    <li><a href="#">Delta</a></li>
    <li><a href="#">Epsilon</a></li>
    <li><a href="#" onclick="document.getElementById('id01').style.display='block'">Login</a></li>
  </ul>





     <div class="info">
        <span class="closebtn">&times;</span>
        <b>Info!</b> You are currently on latest version of Smileybook
        <i>Smileybook 1.2</i>
        Subscribe to Smileybook Notifications and Share you comments on Mail.
      </div>



<button class="btn submit_btn form-control" onclick="document.getElementById('id01').style.display='block'" style="width:20px,">Login</button>


<div id="id01" class="modal">


   <form class="modal-content animate" action="https://yashdamani.000webhostapp.com/account/account.html">


<div class="imgcontainer">
<span onclick="document.getElementById('id01').style.display='none'" class="close" title="Close ">&times;</span>
</div>



  <div class="container">
  <label><b><i><font color="70bafe">Username</font></i></b>
</label>

     <input type="text" placeholder="Enter Username"name="user" required>




    <label><b><i><font color="70bafe" >Password</font></i></b></label>

   <input type="password" placeholder="Enter Password" name="pass" required>


<a href="https://yashdamani.000webhostapp.com/account/account.html" accesskey="enter">
<button class="btn submit_btn form-control" onclick="document.getElementById('id01').style.display='block'" style="width:20px," type="submit">Login</button></a>

<br>


 <input type="checkbox" checked="checked">
<font color="70bafe" > Remember me
  </font>
</div>



 <div class="container" style="background-color:#f1f1f1">

  <button type="button" onclick="document.getElementById('id01').style.display='none'" class="cancelbtn">
<font color="0A026A"><b>Cancel</b></font></button>


<br>


<a href="https://yashdamani.000webhostapp.com/forgotpassword.html"  accesskey="" ><font color="70bafe" > Forgot Password?</a></font>

<hr color="70bafe">

</div>
</div>

 </form>


 <script>
 // Get the modal
 var modal = document.getElementById('id01');

 // When the user clicks anywhere outside of the modal,close it
 window.onclick = function(event) {
     if (event.target == modal) {
         modal.style.display = "none";
     }
 }

 </script>



 <script>
 var close = document.getElementsByClassName("closebtn");
 var i;

 for (i = 0; i < close.length; i++) {
   close[i].onclick = function(){
     var div = this.parentElement;
     div.style.opacity = "0";
     setTimeout(function(){ div.style.display = "none"; },600);
   }
 }
 </script>

  <script src='./jquery.min.js'></script>
  <script  src="./script.js"></script>


</body>
</html>

和样式css

#nav-1 {
  position: absolute;
  border: none;
  float: none;
  border-radius: 20em;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  list-style: none;
  background: #f5f5f5;
  box-shadow: 20px 40px 40px #00000033;
  padding: 10px;
}
#nav-1 li {
  margin: 0px;
}
#nav-1 li a {
  position: relative;
  padding: 0.6em 2em;
  font-size: 18px;
  border: none;
  outline: none;
  color: #333;
  display: inline-block;
  text-decoration: none;
  z-index: 3;
}
#nav-1 .slide1,#nav-1 .slide2 {
  position: absolute;
  display: inline-block;
  height: 3em;
  border-radius: 10em;
  -webkit-transition: all 0.6s cubic-bezier(0.23,1,0.32,1.05);
  transition: all 0.6s cubic-bezier(0.23,1.05);
}
#nav-1 .slide1 {
  background-color: lightblue;
  z-index: 2;
}
#nav-1 .slide2 {
  opacity: 0;
  background: #ddd;
  z-index: 1;
}
#nav-1 .squeeze {
  -webkit-transform: scale(0.9);
          transform: scale(0.9);
}

*,*::before,*::after {
  box-sizing: border-box;
}

html,body {
  height: 80px;
}

body {
  display: -webkit-box;
  display: flex;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-align: center;
          align-items: center;
  background-color: #e0e0e0;
  font-family: Montserrat,sans-serif;
  line-height: 1.5;
  background: white;
}

这是我正在使用的新网站。最近,我看到了这个导航栏,并喜欢使用它,以为可以使用它,但是现在却面临着彼此浮动的问题。我在上面附加了相同的代码以及图像。 Navbar overflow problem picture (click here) 因此,我只是想尽快解决此问题,因为我的托管日期不太远。 请检查我的密码。

解决方法

尝试一下: 将padding-top添加到“ info”类。

.info{
      padding-top:50px;
 }
,

尝试为元素添加页边空白 或padding-top

.info {
margin-top 50px;
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 &lt;select id=&quot;xxx&quot;&gt; SELECT di.id, di.name, di.work_type, di.updated... &lt;where&gt; &lt;if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 &lt;property name=&quot;dynamic.classpath&quot; value=&quot;tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-