【问题标题】:Nav is not selectable导航不可选择
【发布时间】:2019-12-10 16:56:36
【问题描述】:

网站上的导航不允许我点击或选择。我不确定为什么。这些页面都正确链接。当我检查页面时,我可以点击功能链接。导航位于两个部分之间,标题和关于部分。每个部分都有几个元素。其中大部分我必须使用绝对位置才能将元素移动到我想要的位置。

#header {
	font-family: "Eras Demi ITC", sans-serif;
	color: white;
	background: rgba(174, 4, 33 );
	width: 100%;
	height: 20%;
	display:inline-block;
}
#header2 {
	font-family: "Eras Demi ITC", sans-serif;
	color: white;
	width: 100%;
	height: 20%;
	display:inline-block;
}
#mainHeader h1{
	text-align: left;
	display:inline-block;
}
#mainHeader img{
	width:100%;
}
    
body {
	margin:0;
	padding:0;
	background-color:black;
	background-repeat: no-repeat;
	background-position: center;
}
.path img{
	display:inline-block;
	position:absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, 200px);
}
#nav a:link{
	width:50%:
	height:2%;
	text-align:center;
	padding:1%;
	background-color:white;
	display:block;
	height:30px;
	padding:0;
}
#aboutMe img{
	text-align:center;
	width:100%;
	height:500px;
	object-fit: cover;
}
#path {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, 870px);
}
.div1 {
	display:inline-block;
	width: 20px;
	height: 30px;
	text-align: center;
	border: 2px solid white;
	text-align:center;
	box-sizing: border-box;
	color:white;
	position:absolute;
	left:33.5%;
	bottom:-55px;
}
#aboutMe p {
	display:inline-block;
	text-align:center;
	background-color:rgba(174, 4, 33, .6);
	padding:4px;
	width:40%;
	position:absolute;
	left:55%;
	bottom:-30%;
}
#aboutMe h2 {
	color:white;
	display:inline-block;
	position:absolute;
	left:30%;
    }
#aboutMe {
	margin:none;
}
<div class="path">
	<img src="images/path.png"/>
</div><!--path-->	
<div id="header">
	<div id="mainHeader">
		<img src="images/banner1.jpg" alt="Black Background"/>
		<h1>words</h1>
	</div><!--mainHeadereader-->
</div><!--header-->  

<div id="nav">
	<a href="#aboutMe">About Me</a>
	<a href="index.html#work">Work</a>
	<a href="index.html#contact">Contact</a>
</div><!--nav-->

<div id="aboutMe">
	<div class="aboutImg">
	<img src="images/pic.jpg" alt="Black Background"/>
	<h2>About Me</h2>
    <div class="div1">1</div>
</div>

【问题讨论】:

  • 欢迎来到 SO。首先,您应该使用正确的标签来标记您的问题。有关更多详细信息和示例标签,请参见此处:[stackoverflow.com/tags] 第二件事是您的 HTML 甚至看起来格式不正确。请先解决此问题并提供格式正确的代码,以便任何人都可以快速阅读。
  • 请注意,&lt;img&gt; 标签不使用也不需要结束斜杠,并且在 HTML 中从来没有。

标签: html css nav


【解决方案1】:

你在你的CSS #nav a:link{#nav a{。 查看更多关于styling links的详细信息

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-04-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多