3

I am trying to create a simple scroll button using only HTML and CSS, (JS coming later to enable to parallax (that's not an issue)). But when viewed in Firefox and Google Chrome at least, the link has the visual characteristics of a link but the cursor doesn't alter when hovered above it. I have tried to search Google but I haven't located anything; thus far that has been of any help.

Here is the code I have so far:

HTML

<!DOCTYPE html> 
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, intial-scale=1"> <!--required for mobile responsivenss-->

<title>Zac Steele Photography</title>

    <link rel="stylesheet" href="style.css" type="text/css"> <!--CSS Stylesheet-->
    <link rel="stylesheet" href="css/jquery.bxslider.css"> <!--jQuery plugin for BX Slider-->
    <link rel="stylesheet" href="css/font-awesome.min.css"> <!--plugin for fonts/icons-->
    <link rel="shortcut icon" href="img/#" type="image/png"> <!--Required for icon in <title>-->
</head>

<body>
    <script src="js/jquery-1.11.2.min.js"></script>
    <script src="js/jquery.bxslider.min.js"></script> <!--Slider Plugin-->

<!--start of navbar-->

<header>
    <div class="header-inner">
            <a href="index.html" id="logo"></a>
        <nav>
            <a href="img/nav.png" id="nav-icon"></a>
            <ul>
                <li><a href="index.html" class="current">Home</a></li>
                <li><a href="#about">About</a></li>
                <li><a href="#portfolio">Portfolio</a></li>
                <li><a href="#prints">Prints</a></li>
                <li><a href="#contact">Contact</a></li>
            </ul>
        </nav>
    </div>
</header>

<div class="clearfix"></div>

<!--end of navbar-->

<div class="clearfix"></div>

<!--start of main-parallax section-->

<section class="main-parallax" style="height: 100%; position: relative;">
    <div class="main-parallax-inner">
        <img src="#" alt="">
        <h1>I am Zac Steele</h1>
        <h1>This is my portfolio.</h1>
        <a id="scrollbtn" href="#about">Scroll</a>
    </div>
    </div>
</section>

<!--end of main-parallax section-->

<div class="clearfix"></div>

<!--start of about section-->

<div class="about-wrapper">
    <h1>About</h1>
<section class="about-parallax">
    <div class="about-parallax-inner">
        <img src="#" id="aboutBack" alt="">
        <img src="#" alt="portrait of me">
        <p>Lorem ipsum dolo
        r sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</section>
</div>

<!--end of about section-->

<div class="clearfix"></div>

<!--start of portfolio section-->

<div class="portfolio-wrapper">
    <h1>Portfolio</h1>
<section class="portfolio-parallax">
    <div class="portfolio-parallax-inner">
        <img src="#" id="portfolioBack" alt="">
        <div class="row1">
            <img src="#" alt="1">
            <img src="#" alt="2">
            <img src="#" alt="3">
        </div>
        <div class="row2">
            <img src="#" alt="4">
            <img src="#" alt="5">
            <img src="#" alt="6">
        </div>
    </div>
</section>
</div>

<!--end of portfolio section-->

<div class="clearfix"></div>

<!--start of prints section-->
<div class="prints-wrapper">
    <h1>Prints</h1>
<section class="prints-parallax">
    <div class="prints-parallax-inner">
        <img src="#" id="printsBack" alt="">
        <div class="row1">
            <img src="#" alt="1">
            <img src="#" alt="2">
            <img src="#" alt="3">
        </div>
        <div class="row2">
            <img src="#" alt="4">
            <img src="#" alt="5">
            <img src="#" alt="6">
        </div>
    </div>
</section>
</div>

<!--end of prints section-->

<div class="clearfix"></div>

<!--Start one-third section-->

<div id="one-third-wrapper">
    <h1>Full Width Heading Title Section</h1>
    <section class="one-third">
        <img src="https://www.w3newbie.com/wp-content/uploads/beach-camera.png">
        <h3>Heading Title Text</h3>
        <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</p>
    </section>
    <section class="one-third">
        <img src="https://www.w3newbie.com/wp-content/uploads/girl-camera.png">
        <h3>Heading Title Text</h3>
        <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</p>
    </section>
    <section class="one-third">
        <img src="https://www.w3newbie.com/wp-content/uploads/girl-beach.png">
        <h3>Heading Title Text</h3>
        <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.</p>
    </section>
</div>

<!--End one-third section-->

<div class="clearfix"></div>

<!--start of contact section-->
<div class="contact-wrapper">
    <h1>Contact</h1>
<section class="contact-parallax">
    <div class="contact-parallax-inner">

    </div>
</section>
</div>

<!--end of contact section-->

<!--start social footer-->

<footer>
    <ul class="social">
        <li><a href="https://www.facebook.com" target="_blank"><i class="fa fa-facebook"></i></a></li>
        <li><a href="https://plus.google.com" target="_blank"><i class="fa fa-google-plus"></i></a></li>
        <li><a href="https://www.twitter.com" target="_blank"><i class="fa fa-twitter"></i></a></li>
        <li><a href="https://www.youtube.com" target="_blank"><i class="fa fa-youtube"></i></a></li>
        <li><a href="https://www.instagram.com/" target="_blank"><i class="fa fa-instagram"></i></a></li>
    </ul>
</footer>

<!--end social footer-->

<!--start socket footer-->

<footer>
  <p style="text-align: center;">&copy; Zac Steele. MMXVII.</p>
</footer>

<!--end socket footer-->

</body>
</html>

CSS:

@import url('https://fonts.googleapis.com/css?family=Montserrat');

* {
    margin: 0;
    padding: 0;
    width: 100%;
}

body {
    font-family: sans-serif;
    color: #4D4D4D;
    text-align: center;
    position: relative;
}

h1 {
    font-size: 500%;
    letter-spacing: -1px;
    text-align: center;
    color: #4D4D4D;
    text-transform:;
}

img {
    height: auto;
    margin-bottom: 0px;
}

header {
    background-color: #4D4D4D;
    height: 86px;
    width: 100%;
    opacity: transparent;

}

#header-inner {
    max-width: 1200px;
    margin: 0 auto;
}

#logo {
    float: left;
    width: 200px;
    height: 65px;
    margin: 10px;
    background: url(https://placehold.it/100x100) no-repeat center;
}

nav {
    float: right;
    width: 50%;
    margin: 2% 0;
}

ul {
    list-style: none;
}

nav ul li {
    font-family: sans-serif;
    font-size: 18px;
    display: inline;
    padding: 0 30px;
}

nav ul li a {
    color: #FFF;
    text-decoration: none;

}

nav ul li:hover a {
    color: #63D1F4;
}

.current {
    color: #C3D7DF;
}

/* end of navbar */

/* start of main parallax */

.main-parallax {
    background: url() no-repeat;
    background-size: contain !important;
    position: fixed;
    width: 100%
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    margin: 0;
}

.main-parallax-inner {
    padding-top: 180px;
    padding-bottom: 300px;
}

#scrollbtn {
    cursor: pointer;
}

I haven't been coding too long so take it easy on me. Anything that you guys/girls can contribute would be awesome.

Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
Elliot
  • 31
  • 1
  • 2
  • 2
    You have some z-index issues. One that stands out is .main-parallax which has a z-index of -1 – Tim Barnett Jan 13 '17 at 15:01
  • ` ` that closing div doesn't have an opening div for it. Put it in a code editor and you'll see for yourself and the HTML source would have shown you that too. – Funk Forty Niner Jan 13 '17 at 15:02
  • Cheers Tim - pretty stupid mistake. Apart from that is there anything you would change regarding the code? – Elliot Jan 13 '17 at 15:04
  • You're also missing a closing div for `
    ` or for `
    `
    – Funk Forty Niner Jan 13 '17 at 15:04
  • Sorry Fred but that wouldn't effect the link anyway. Thanks for spotting that though. – Elliot Jan 13 '17 at 15:05
  • Oh I know that, but your page will more than likely no run the way you want it to and will give some unpleasant/unexpected results. – Funk Forty Niner Jan 13 '17 at 15:06
  • has now been closed. – Elliot Jan 13 '17 at 15:07
  • there's not just one, but a few. Get yourself a code editor with pair matching, it will help you a lot. It has helped me a lot and realize I was working too hard without one. – Funk Forty Niner Jan 13 '17 at 15:09
  • Seeing an answer below just now, I believe that @TimBarnett should have been invited to post an answer here, IMHO. – Funk Forty Niner Jan 13 '17 at 15:09
  • I totally agree, Fred. I don't know if I can do that? – Elliot Jan 13 '17 at 15:11
  • Sure you can. As for a code editor: If you're on a Windows platform, Notepad++ is a good one and it's free (I use it myself) - I recommend it https://notepad-plus-plus.org/ and choose the "HTML" from the "Language" dropdown. If you're on MAC OS, there's a whole bunch listed here http://stackoverflow.com/q/20533/1415724 – Funk Forty Niner Jan 13 '17 at 15:14
  • I actually meant can I invite Tim to answer the question? I'm on Windows until moving back onto Linux when my PC is back up and running. I'm currently using Sublime Text 3 which is pretty cool. It has the pair matching I believe. I've just been messing around and haven't spotted them. You pointed them out before I did which is a plus. Side-note, Texas gunslinging music is the dogs dangly bits! – Elliot Jan 13 '17 at 15:18
  • @Elliot *lol* Yeah, I just noticed now and edited my comment. I thought you were asking if you could get an editor. Sorry, my "duh" moment of the day. Yes; there is nothing wrong in asking a member to post an answer based on their comment. You just need to "ping" them using the `@` symbol and followed by their name, just as I did for you here in comments. On LINUX, it has its own code editor: qedit which I also use, it's pretty good also. Sublime Text 3 I like also but am so used to using Notepad++ that I've grown attached to it. *"Texas gunslinging music is the dogs dangly bits!"* - Yes sir! – Funk Forty Niner Jan 13 '17 at 15:21
  • 1
    @TimBarnett would you be willing to post your answer mate? – Elliot Jan 13 '17 at 15:22
  • @Fred-ii- aha! I'm learning more and more! We all have them, man - as long as it's just one moment per day it's all gravy! I've "pinged" Tim so we shall see what he says. He deserves the credit for his whippet-like answer time. Notepad++ did serve me well and I might switch back to it to reminisce. SRV is on, you've gone and done it now haha. – Elliot Jan 13 '17 at 15:26
  • @Elliot Yeah, Stevie's one of my guitar heros but have to admit that Jimmy Page was my first. See the other videos I have under *"If it has strings on it, I'll pick & bend 'em."* - You might like 'em, enjoy! ♫ *cheers!* – Funk Forty Niner Jan 13 '17 at 15:28
  • @Elliot, sorry for the delay, did you get everything sorted out? – Tim Barnett Jan 16 '17 at 16:38

1 Answers1

2

In your CSS :

.main-parallax {
z-index: -1;
}

Should be replaced by :

.main-parallax {
z-index: 1;
}

That way, your anchor will be clickable !

PS : You can erase this, it's not usefull :

#scrollbtn {
    cursor: pointer;
}
André DS
  • 1,823
  • 1
  • 14
  • 24