我的标题未显示在我的网站上。 (HTML)

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

我目前正在学习 HTML,遇到了一个问题。目前,我的 header.html 页面中有导航栏,我正在尝试将其嵌入到我的主 index.html 中,但它似乎不起作用。有人可以帮助我吗?

这是我的代码:

<!DOCTYPE html>
<html lang="en">
<link rel="stylesheet" href="styles.css"/>
<header>
        <nav>
            <a href="#">Home</a>
            <a href="#">Projects</a>
            <a href="#">Certifications</a>
            <a href="#">Experience</a>
            <a href="#">Others</a>
            <div class="animation start-home"></div>
        </nav>
</header>
</html>

THIS IS MY INDEX.HTML CODE
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="styles.css">
        <link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet'>
        <title>Homepage</title>

    </head>
    <body>
        <div w3-include-html="header.html"></div>
        
        <div class="background">
            <div>
                <div class="Page_Title">
                    <h1>RITHVIK VADDADI</h1> 
                </div> 
                <div class="arrow-wrap">
                    <div class="arrow-down arrow"></div>
                    <div class="arrow-down arrow"></div>
                </div>
            </div>
        </div>

        <div class="About">
            <h2>About Me</h2>
            <div class="ABT">
                <img src="Images/My PFP.jpg" alt="Avatar" class="Avatar">
                <p class="desciption">Hello, I am Rithvik Vaddadi, a current NSF with a diploma in Cyber Security and Digital Forensics. Drawn to the world of computers, I aspire to make people's lives easier and protect them from cyber attacks with the help of technology around us. As a problem solver, I am known to use my creative and critical thinking skills when providing solutions in my past leadership roles and projects. When involved in projects, I tend to notice people's strengths and weaknesses and assign them to roles where their potential would be fully maximized in the project. When my mind is fixed on a goal, I dedicate my energy and focus to achieving the goal.</p>
            </div>
            <h3>Looking</h3>
        </div>
        

    </body>
</html> 

THIS IS MY CSS CODE:
nav{
    position: relative;
    margin: 27px auto 0;
    width: 590px;
    height: 50px;
    background: black;
    border-radius: 8px;
    font-size: 0;
    box-shadow: 0 2px 3px 0 rgba(0,0,0,.1);
}

nav a{
    font-size: 15px;
    text-transform: uppercase;
    color: whitesmoke;
    text-decoration: none;
    line-height: 50px;
    position: relative;
    z-index: 1;
    display: inline-block;
    text-align: center;
}

nav .animation{
    position: absolute;
    height: 5px;
    bottom: 0;
    z-index: 0;
    background: darkred;
    width: 100px;
    border-radius: 8px;
    transition: all .5s ease 0s;
}

a:nth-child(1){
    width: 100px;
}

nav .start-home,a:nth-child(1):hover~.animation{
    width: 100px;
    left: 0;
}

a:nth-child(2){
    width: 100px;
}

nav .start-projects,a:nth-child(2):hover~.animation{
    width: 100px;
    left: 100px;
}

a:nth-child(3){
    width: 150px;
}

nav .start-certifications,a:nth-child(3):hover~.animation{
    width: 150px;
    left: 200px;
}

a:nth-child(4){
    width: 100px;
}

nav .start-others,a:nth-child(4):hover~.animation{
    width: 100px;
    left: 350px;
}

a:nth-child(5){
    width: 100px;
}

nav .start-others,a:nth-child(5):hover~.animation{
    width: 100px;
    left: 450px;
}

.background{
    background-image: url(Images/CardistryBGD2.jpg);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    height: 100vh;
    padding-top: 5px;
    margin: -8px; 
}

.Page_Title{
    text-align: center;
    overflow: auto;
    height: 500px;
    width: auto;
    line-height: 320px;
    position: relative;
    margin-bottom: 8px;
}

.arrow-wrap {
    position: relative;
    bottom: 0px;
    -webkit-animation: arrow 0.5s 1s infinite ease-out alternate;
    -moz-animation: arrow 0.5s 1s infinite ease-out alternate;
    -o-animation: arrow 0.5s 1s infinite ease-out alternate;
    animation: arrow 0.5s 1s infinite ease-out alternate;
    width: 56px;
    margin-left: 600px;
}
  
.arrow-wrap:hover {
    -webkit-animation-play-state: paused;
    -moz-animation-play-state: paused;
    -o-animation-play-state: paused;
    animation-play-state: paused;
}
  
.arrow {
    padding: 15px;
    border-left: solid 5px red;
    border-bottom: solid 5px whitesmoke;
    position: relative;
    display: inline-block;
}
  
.arrow-down {
    transform: rotate(-45deg);
    bottom:200px;
    margin-top: -50px;
    position: relative;
}
  
@-webkit-keyframes arrow {
    0% {
      bottom: 0px;
    }
    100% {
      bottom: 10px;
    }
}
  
@-moz-keyframes arrow {
    0% {
      bottom: 0px;
    }
    100% {
      bottom: 10px;
    }
}
  
@keyframes arrow {
    0% {
      bottom: -100px;
    }
    100% {
      bottom: -90px;
    }
}

h1{
    font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    font-size: 9vw;
    color: white;
}

h2{
    text-align: center;
    color: white;
    font-size: 3vw;
    margin: 8px;
    padding: 30px;
}

.Avatar{
    vertical-align: middle;
    width: 145px;
    height: 140px;
    border-radius: 50%;
    margin-left: 75px;
}

.About{
    margin: -9px;
    background-image: url(Images/CardBG.jpg);
    background-size: 100%;

}

.ABT{
    display: flex;
    max-width: 1150px;
    align-items: center;
    color: white;
    margin-top: -20px;
    font-family: 'Montserrat';
}

.desciption{
    margin-left: 50px;
}

最初,一切都在index.html上,直到我将导航栏分成一个单独的html页面,我无法弄清楚出了什么问题。

html css header
1个回答
0
投票

您忘记包含脚本w3.js

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.