老师,我的导航间白线出不来

来源:3-2 表示层--导航的实现

幕布斯1062488

2020-08-18 11:47:13

<span></span>

   <nav>

       <a href="#">泸沽湖</a>

       <a href="#">丽江古城</a>

       <a href="#">茶马古道</a>

       <a href="#">就这家·云逸客栈</a>

       <a href="#">西双版纳</a>

       <a href="#">云南红酒庄</a>

       <a href="#">轿子雪山</a>

       <a href="#">普者黑</a>

       <a href="#">海埂大坝</a>

       <a href="#">玉龙湾</a>

       <a href="#">昆明郊野公园</a>

       <a href="#">欧洲风琴小镇</a>

   </nav>


* {

   margin: 0;

   padding: 0;

   border: none;

}


html,

body {

   height: 100%;

   background: #93b3c6;

}


span {

   display: block;

   width: 16px;

   height: 16px;

   margin: 30px auto 40px;

   border-radius: 50%;

   background: #fff;

}


nav {

   display: flex;

   width: 78.125vw;

   margin: 0 auto 45px;

   justify-content: space-between;

   position: relative;

}


nav::before {

   position: absolute;

   top: 20px;

   width: 100%;

   height: 10px;

   background: #fff;

   display: block;

   content: "";

}


nav>a {

   position: relative;

   font-size: 20px;

   padding: 10px;

   border: 2px solid #5395b4;

   white-space: nowrap;

   color: #255d7e;

   text-decoration: none;

   background: #fff;

}


写回答

1回答

好帮手慕久久

2020-08-18

同学你好,老师测试你的代码,可以显示白线:

http://img.mukewang.com/climg/5f3b842f09334b4a15950221.jpg

同学那里不显示,可能原因是同学的屏幕宽度太小了,如下:

http://img.mukewang.com/climg/5f3b848409d3af0117480263.jpg

可以这样调整一下:

http://img.mukewang.com/climg/5f3b84b1092efb8705150232.jpg

如果我的回答帮到了你,欢迎采纳,祝学习愉快!

0

0 学习 · 14456 问题

查看课程