所以在我网站上的每个其他页面中,我都有位于页面中间的文本,以及一个带有悬停激活按钮/下拉列表的导航栏,但随后在一个页面上,我有一个后面带有链接的img它,并移动文本正文。现在导航栏根本没有任何可点击的内容。取出文本的div修复了问题。我把它放回来,禁用CSS中的相对定位,并修复了导航。我唯一能想到的可能是移动文本向上移动按钮后面的链接? Idk我怎么会改变它,但因为从我的代码链接只是绑定到按钮。
body {
background: url(http://digitalart.io/wp-content/uploads/2014/05/Super-Elementatl-Giant-Wallpaper.jpg) no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
margin: 100%
}
.maintextbody {
color: white;
align-self: auto;
}
.prcpagelink {
position: relative;
max-width: 200px;
width: 20px;
display: block;
left: 655px;
border-radius: 50px;
}
.prcimg {
position: relative;
align-self: auto;
margin: 0 auto 0 auto;
display: block;
height: 360px;
width: 580px;
bottom: 390px;
}
.prcdisclaimer {
position: relative;
align-self: auto;
margin: 0 auto 0 auto;
color: white;
font-size: 1.2em;
bottom: 380px;
left: 760px;
}
.maintextbodyGallery {
position: relative;
color: white;
align-self: auto;
margin: 0 auto 0 auto;
bottom: 170px;
}
h3 {
text-align: center;
padding: 300px;
}
/* Dropdown Button */
.dropbtn {
background-color: #111;
margin: 5px 0 0 175px;
color: #888;
padding: 12px 19px 14px 19px;
font-size: 17px;
border: none;
cursor: pointer;
border-radius: 10px;
}
/* The container <div> - needed to position the dropdown content */
.dropdown {
position: relative;
display: inline-block;
}
/* Dropdown Content (Hidden by Default) */
.dropdown-content {
display: none;
position: absolute;
background-color: white;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
margin: 1px 0 0 175px;
border-radius: 10px;
}
/* Links inside the dropdown */
.dropdown-content a {
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
border-radius: 10px;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {background-color: #white}
/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
display: block;
}
/* Change the background color of the dropdown button when the dropdown content is shown */
.dropdown:hover .dropbtn {
background-color: #333;
}
.navbar-brand {
margin: 5px 0 5px 430px;
background: #111;
border-radius: 10px;
}
.navbar-yt {
margin: 5px 0 5px 220px;
background: #111;
border-radius: 10px;
}
.navbar-tw {
margin: 5px 0 5px 240px;
background: #111;
border-radius: 10px;
}
.navbar-inverse {
padding: 0 0 0 50px;
background: #111;
}
HTML
<!DOCTYPE html>
<html>
<head>
<!-- <meta http-equiv="refresh" content="3" > -->
<title>My Best Creations</title>
<link rel="stylesheet" type="text/css" href="main.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
</head>
<body>
<header class="navbar-inverse" role=banner>
<div class="container">
<nav role="navigation">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
<span class="sr-only"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand-gallery" href="https://www.linkedin.com/profile/preview?vpa=pub&locale=en_US"><font size="3">The Jay Button</font></a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li><a class="navbar-yt" href="https://www.youtube.com/channel/UCAw2reL5kCmudL6GSdK2WEQ"><font size="3">Youtube</font></a></li>
<li><a class="navbar-tw" href="https://twitter.com/Josh_Marino_"><font size="3">Twitter</font></a></li>
</ul>
</li>
</ul>
<div class="dropdown">
<button onmouseover="myFunction()" class="dropbtn">More</button>
<div id="myDropdown" class="dropdown-content">
<a href="index.html">Home</a>
<a href="JaysCodingBackground.html">Jays Coding Background</a>
</div>
</div>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
</header>
<div class="maintextbodyGallery"><font face="Garamond"><h3>Step into my gallery. Behold some of my favorite creations. <br> Of which there is only one right now.</h3></font></div>
<div>
<a href="http://providencereformedchurch.com/" class="prcpagelink""><img class="prcimg" src="http://i.imgur.com/O3Lyws6.jpg"></a>
</div>
<div class="prcdisclaimer">Disclaimer: This website is still under devlopment</div>
<script src="javascriptforjaysfl.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
</body>