我无法让我的下拉菜单处理HTML / CSS

问题描述 投票:0回答:1

我一直在尝试为我的项目获取交互式简历页面的下拉菜单项。我似乎无法让它工作。我试着谷歌搜索结果,但有些让它变得更糟。我尝试在堆栈溢出时咨询其他答案,但似乎没有人在做这个伎俩。总的来说,它基本上毁了我其他页面的结构。现在我只想集中精力让主页打补丁。

/* /// Footer Section /// */

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #00cca3;
  text-align: center;
  color: black;
}


/* Navigation/Menu Bar */

.navbar {
  overflow: hidden;
  background-color: #00cca3;
  position: fixed;
  top: 0;
  width: 100%;
}

.navbar a {
  float: none;
  display: inline;
  font-size: 18px;
  text-align: center;
  color: black;
  padding: 20px 20px;
}


/* .navbar a:hover, a:active {
    float: none;
    display: inline;
    font-size: 18px;
    text-align: center;
    color: white;
    padding: 40px 60px;
    text-decoration: none;
    background-color: #00e6b8;
}

.navbar a:link, a:visited {
    color: white;
    padding: 40px 60px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
} */

.dropdown {
  float: right;
  overflow: hidden;
}

.dropdown .dropbtn {
  border: none;
  outline: none;
  color: black;
  padding: 20px 20px;
  font-family: inherit;
  margin: 0;
  background-color: #00cca3
}

.navbar a:hover,
.dropdown:hover .dropbtn {
  background-color: #00e6b8;
}

.dropdown-content {
  display: list-item;
  position: absolute;
  background-color: #00cca3;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.dropdown-content a {
  float: left;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #00e6b8;
}

.dropdown:hover .dropdown-content {
  display: block;
}
<!DOCTYPE html>
<html lang="en-US">

<head>
  <title>
    Interactive Resume
  </title>
  <meta charset="UTF-8">
  <meta name="Project" content="Code for Online Interactive Resume">
  <meta name="viewport" content="width=device-width, initial-scale= 1.0">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
  <link rel="stylesheet" type="text/css" href="style/css.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
  <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>
  <script src="scripts/script.js"></script>
</head>

<body>
  <div class="navbar">
    <a href="index.html"><i class="fas fa-home"></i> Home</a>
    <a href="exp.html"><i class="fas fa-briefcase"></i> Experience</a>
    <a href="port.html"><i class="fas fa-folder-open"></i> Portfolio </a>
    <div class="dropdown">
      <button class="dropbtn">
                <i class="fas fa-caret-down"></i>
            </button>
      <div class="dropdown-content">
        <a href="jq.html">jQuery Project</a>
        <a href="json.html">JSON Project</a>
        <a href="php.html">PHP Project</a>
        <a href="sql.html">SQL Project</a>
        <a href="py.html">Python Project</a>
        <a href="cpp.html">C++ Project</a>
      </div>
    </div>
    <a href="about.html"><i class="fas fa-question-circle"></i> About</a>
    <a href="contact.html"><i class="fas fa-phone"></i> Contact</a>
  </div>
html5 css3
1个回答
0
投票

Demo

/* /// Footer Section /// */



/* Navigation/Menu Bar */

.navbar {
  background-color: #00cca3;
  position: fixed;
  top: 0;
  width: 100%;
}

.navbar a {
  float: none;
  display: inline;
  font-size: 18px;
  text-align: center;
  color: black;
  padding: 20px 20px;
}

/* .navbar a:hover, a:active {
    float: none;
    display: inline;
    font-size: 18px;
    text-align: center;
    color: white;
    padding: 40px 60px;
    text-decoration: none;
    background-color: #00e6b8;
}

.navbar a:link, a:visited {
    color: white;
    padding: 40px 60px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
} */

/*.dropdown {
  float: right;
  overflow: hidden;
}

.dropdown .dropbtn {
  border: none;
  outline: none;
  color: black;
  padding: 20px 20px;
  font-family: inherit;
  margin: 0;
  background-color: #00cca3
}

.navbar a:hover,
.dropdown:hover .dropbtn {
  background-color: #00e6b8;
}

.dropdown-content {
  display: list-item;
  position: absolute;
  background-color: #00cca3;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.dropdown-content a {
  float: left;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background-color: #00e6b8;
}

.dropdown:hover .dropdown-content {
  display: block;
}*/

.dropbtn {
  color: white;
  padding: 16px;
  font-size: 16px;
  border: none;
  background-color: #00cca3;
}

.dropdown {
  position: relative;
  display: inline-block;
  background-color: #00cca3;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #00cca3;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

.dropdown-content a {
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #00e6b8;
}

.dropdown:hover .dropdown-content {
  display: block;
}

.dropdown:hover .dropbtn {
  background-color: #00e6b8;
}
<!DOCTYPE html>
<html lang="en-US">

<head>
  <title>
    Interactive Resume
  </title>
  <meta charset="UTF-8">
  <meta name="Project" content="Code for Online Interactive Resume">
  <meta name="viewport" content="width=device-width, initial-scale= 1.0">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
  <link rel="stylesheet" type="text/css" href="style/css.css" />
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
  <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.min.js"></script>
  <script src="scripts/script.js"></script>
</head>

<body>
  <div class="navbar">
    <a href="index.html"><i class="fas fa-home"></i> Home</a>
    <a href="exp.html"><i class="fas fa-briefcase"></i> Experience</a>
    <a href="port.html"><i class="fas fa-folder-open"></i> Portfolio </a>
    <div class="dropdown">
      <button class="dropbtn">
                <i class="fas fa-caret-down"></i>
            </button>
      <div class="dropdown-content">
        <a href="jq.html">jQuery Project</a>
        <a href="json.html">JSON Project</a>
        <a href="php.html">PHP Project</a>
        <a href="sql.html">SQL Project</a>
        <a href="py.html">Python Project</a>
        <a href="cpp.html">C++ Project</a>
      </div>
    </div>



    <a href="about.html"><i class="fas fa-question-circle"></i> About</a>
    <a href="contact.html"><i class="fas fa-phone"></i> Contact</a>
  </div>
© www.soinside.com 2019 - 2024. All rights reserved.