Css Div在其他浏览器中的位置随机错误
我的网站导航栏中有一个“register”div,在firefox中,所有内容都能完美呈现,但在Chrome等其他浏览器中,定位有时会完全关闭,但如果我刷新页面,它会自行修复 此外,如果我检查元素并选中/取消选中“位置:绝对”,它通常会转到正确的位置 这里有很多纠缠不清的代码,所以我提前向您道歉,并感谢您的帮助 我将在下面发布相关代码,但如果您需要查看完整代码,请访问 HTML:Css Div在其他浏览器中的位置随机错误,css,html,position,nav,Css,Html,Position,Nav,我的网站导航栏中有一个“register”div,在firefox中,所有内容都能完美呈现,但在Chrome等其他浏览器中,定位有时会完全关闭,但如果我刷新页面,它会自行修复 此外,如果我检查元素并选中/取消选中“位置:绝对”,它通常会转到正确的位置 这里有很多纠缠不清的代码,所以我提前向您道歉,并感谢您的帮助 我将在下面发布相关代码,但如果您需要查看完整代码,请访问 HTML: <header> <img src="..." onclick="location.hr
<header>
<img src="..." onclick="location.href='../nav/index.php'" />
</header>
<nav>
<ul class="fancyNav">
...
</ul>
<div class="register">
<a class="unlink" id='windowbox' style='border-radius: 10px;width:45px;' href="...">Register</a>
<a class="unlink" id='windowbox' style='border-radius:10px;width:40px;' href="...">Log In</a>
</div>
</nav>
去掉绝对定位,应该没问题
.register{
position: absolute;
display: inline;
width:auto;
height:auto;
margin: 5px;
font-size: 18px/20px;
}
a.unlink{
color:#0f0000;
text-decoration: none;
clear: both;
}
a:hover.unlink{
color:#ecf7ed;
text-decoration: none;
clear:both;
}
#windowbox{
border-bottom-left-radius:10px;
border-bottom-right-radius:10px;
margin-left: auto;
margin-right: auto;
padding: 5px;
width :auto;
height:auto;
background: #c3912b url('../assets/img/nosp.png') repeat;
border: 1px solid #666666; /***/
-webkit-box-shadow: 5px 5px 10px .5px rgba(100, 100, 100, .3);
box-shadow: 5px 5px 10px .5px rgba(100, 100, 100, .3);
}
.fancyNav{
position: relative;
text-align: start;
display: inline;
margin: 0;
padding: 15px 4px 17px 0;
list-style: none;
-webkit-box-shadow: 5px 5px 10px .5px rgba(100, 100, 100, .3);
box-shadow: 5px 5px 10px .5px rgba(100, 100, 100, .3);
}