javascript - :hover is not working -
i new web development, although appreciated, not looking critiques on "best practices", realize not beautiful code, not sure why a:hover function not working. indeed work other parts of code not included not sure why code not work, insight appreciated.
note: there no issue .css filepath or anything, other styles elements work fine.
so question have included 2 files, .html file main.css file. have removed personal information , code not pertinent actual issue.
a { text-decoration: none; } a:hover { text-decoration: underline; text-decoration-color: white; } html { margin: 0px; } body { margin: 0px; min-height: 100%; } .home { position: relative; z-index: -2; } .intropage { position: fixed; z-index: 100; height: 100%; width: 100%; overflow: hidden; } #enterwebsite { font-family: 'cookie'; font-size: 48px; color: white; border: solid white 2px; border-radius: 15px; text-align: center; padding: 10px 25px; } #enterwebsite:hover { font-family: 'cookie'; font-size: 48px; color: black; border: solid black 2px; border-radius: 15px; text-align: center; padding: 10px 25px; } .enterbutton-container { position: absolute; top: 60%; left: 39.5%; } .enterbutton { text-align: center; } .backgroundimage { display: flex; justify-content: center; align-items: center; height: 100%; background-image: url("styles/images/sf2.jpg"); background-position: center center; background-repeat: no-repeat; background-size: cover; background-attachment: fixed; } .backgroundimage img { min-width: 100%; width: 100%; height: auto; position: fixed; overflow: hidden; } .navigation { display: flex; background: rgba(10, 10, 10, 0.9); } .logo { display: flex; flex-grow: 30; justify-content: center; align-items: flex-start; } h2 { color: white; font-family: 'raleway'; } p { color: white; padding: 32px; font-family: 'raleway'; background-color: rgba(0, 0, 0, 0.2); border-radius: 10px; } .logo h1 { margin: 0; color: rgba(230, 230, 230, 1.0); font-family: 'raleway'; font-size: 32px; } #logotop { text-decoration: underline; } #logobottom { text-decoration: overline; } .logotext { justify-content: center; } .intro-container { display: flex; justify-content: center; margin-top: 150px; } .intro { display: flex; flex-flow: column; align-items: center; width: 40%; background-color: rgba(0, 0, 0, 0.6); border-radius: 25px; } .menu { flex-grow: 70; display: flex; align-items: flex-end; z-index: auto; } .ul-menu { flex-grow: 1; display: flex; list-style-type: none; justify-content: space-between; } .menu-item { flex-grow: 1; color: white; font-family: 'raleway'; } .profilepic img { border: solid 2px cyan; border-radius: 50%; margin-top: -100px; } .topmenuitem { text-decoration: none; color: white; flex-grow: 1; }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <link href='https://fonts.googleapis.com/css?family=raleway' rel='stylesheet'> <link href='https://fonts.googleapis.com/css?family=cookie' rel='stylesheet'> <div class="home"> <div class="navigation"> <div class="logo"> <div class="logocontainer"> <a href="index.html"> <div class="logotext"> <h1 id="logotop">john j</h1> </div> <div class="logotext"> <h1 id="logobottom">jingleheimerschmidt</h1> </div> </a> </div> </div> <div class="menu"> <ul class="ul-menu"> <li class="menu-item"><a class="topmenuitem" href="home.html">home</a></li> <li class="menu-item"><a class="topmenuitem" href="home.html">projects/code</a></li> <li class="menu-item"><a class="topmenuitem" href="home.html">music</a></li> <li class="menu-item"><a class="topmenuitem" href="home.html">websites</a></li> <li class="menu-item"><a class="topmenuitem" href="home.html">about</a></li> <li class="menu-item"><a class="topmenuitem" href="home.html">contact</a></li> </ul> </div> </div> <div class="main-body"> </div> <div class="intro-container"> <div class="intro"> <div class="profilepic"> <img src="assests/profilephoto.jpg" alt="profile picture"> </div> <h2>welcome!</h2> <p>hello, , <a href="home.html"> test link </a> thank visiting. here text <br> <br> <br> here more text </p> </div> </div> </div>
remove
z-index: -2;
at .home class
your body has 1 child tag class home. in case shouldn't set negative z-index. negative z-index means element under others elements
Comments
Post a Comment