I'm making a portfolio page here (http://198.96.94.51/v2/) and while clicking on the navigationMenu links on the side really fast, they don't seem to redirect to the proper anchor (some of them don't move the page at all). I've initialized my anchor tags like this
<ol class="curtains">
<li id="home" class="cover">
<a id="home"></a>
<header data-fade="550" data-slow-scroll="3">
<h1>John Smith</h1>
<h2>HOBBY/JOB TITLE</h2>
</header>
</li>
</ol>
My navbar code -
<ul id="navigationMenu">
<li>
<a class="home" href="#home">
<span>Home</span>
</a>
</li>
<li>
<a class="about" href="#about">
<span>About</span>
</a>
</li>
<li>
<a class="projects" href="#projects">
<span>Projects</span>
</a>
</li>
<li>
<a class="resume" href="#resume">
<span>Resume</span>
</a>
</li>
<li>
<a class="contact" href="#contact">
<span>Contact us</span>
</a>
</li>
</ul>
But just clicking on the navbar, or even typing #home into the address bar won't bring the browser back to the top sometimes. Is there anything I'm doing wrong?
Ids identify anchor points so they must be unique.
But if you just want to go to the top of the page you should try a simple # as value for your href attribute.
A link to the id of e.g. a <div> tag would lead you to this <div> tag.
<div id="anchor"></div>
this fiddle shows you: http://jsfiddle.net/aYGFR/1/
You can give like this: <a id="home" href="home.php">Home</a>
Related
Thanks for solving this issue,
this might be a duplicate but I am new to this and am wondering how I can stop this horizontal scroll on my site, here is a link to it as a codepen codepen and here is it on github github
as i have mentioned I am struggling to get the horizontal scroll to stop and I would rather it wraps onto a new line rather than having it scroll onto a white space
here is an example of the issueexample of the issue
thanks
navbar code as this is causing issue
<nav class="navbar">
<div class="logo">
<a href=index.html>
<img src="Addy Schroeders.png" width="60px" height="60px">
</a>
</div>
<div class="menu">
<li>
<a href="/">
Home
</a>
</li>
<li>
<a href="/">
About
</a>
</li>
<li>
<a href="/">
help and resources
</a>
</li>
<li class="services">
<a href="/">
pages
</a>
<!-- DROPDOWN MENU -->
<ul class="dropdown">
<li>
<a href="template.html">
Dropdown 1
</a>
</li>
<li>
<a href="/">
Dropdown 2
</a>
</li>
<li>
<a href="/">
Dropdown 2
</a>
</li>
<li>
<a href="/">
Dropdown 3
</a>
</li>
<li>
<a href="/">
Dropdown 4
</a>
</li>
</ul>
<li>
<a href="/">
Contact
</a>
</li>
</div>
</ul>
To wrap the content, you can use display: flex and flex-wrap: wrap. This should make it wrap to a new line and fix your issue!
The flex-wrap CSS property can help you set whether flex items are either one line, or if they can wrap in multiple lines.
This is what the HTML looks like:
<ul id="navigation">
<li>
<a href="https://google.com">
<div class="icon icon-user"></div>
<div class="text">About Us</div>
</a>
</li>
</ul>
The problem is that the image shows with the icon but when I click the image, it does not redirect me to the URL link. However it works when I insert a Javascript # link page, how can I fix this so that it redirects me to the URL when I click on the icon?
I am not sure, i just add the target property for the link and it was working fine. Check my code and JSFiddle.
<ul id="navigation">
<li>
<a href="https://google.com" target="_blank">
<div class="icon icon-user"></div>
<div class="text">About Us</div>
</a>
</li>
</ul>
FIDDLE LINK
So i've got a drop-down menu on some elements in the middle of my page. This menu works with purely html and css. Now without any hover the menu items look like this: http://prntscr.com/3es3n8.
With hover however it looks like this: http://prntscr.com/3es3y2.
Now the hover itself works fine and i can style the child elements just fine. My question would be if it was possible for the child element to actually hover over the other items. I know z-index is supposed to do something like this but im not sure how to implement that. I'll try to post as much code as possible but the site is already in ModX.
I'm sorry about all the extra code but the general idea of the situation should be there. http://jsfiddle.net/C8sBp/1/
<div class="row">
<div class="small-12 large-12 columns">
<ul class="small-block-grid-1 large-block-grid-4">
<li>
<div class="icon">
<a href="producten/producten/" title="Kunsmest">
<img src="/i/overview/Fotolia_45201390_XS.jpg" alt="Kunstmest">
</a>
</div>
<div class="text">
<h2>
<nav>
<ul>
<li>
<a href="producten/producten/" title="Kunsmest">
Kunsmest
</a>
<ul>
<li>
<a href="#" title="lorem">
</a><ul><li class="first">test</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</h2>
<p>
</p>
Meer over Kunsmest
</div>
</li>
<li>
<div class="icon">
<a href="producten/zaden" title="Zaden">
<img src="/i/overview/zadenwb.png" alt="Zaden">
</a>
</div>
<div class="text">
<h2>
<nav>
<ul>
<li>
<a href="producten/zaden" title="Zaden">
Zaden
</a>
<ul>
<li>
<a href="#" title="lorem">
</a>
</li>
</ul>
</li>
</ul>
</nav>
</h2>
<p>
</p>
Meer over Zaden
</div>
</li>
<li>
<div class="icon">
<a href="producten/handelsartikelen" title="Handelsartikelen">
<img src="/i/overview/artikelenwb.png" alt="Handelsart">
</a>
</div>
<div class="text">
<h2>
<nav>
<ul>
<li>
<a href="producten/handelsartikelen" title="Handelsartikelen">
Handelsartikelen
</a>
<ul>
<li>
<a href="#" title="lorem">
</a>
</li>
</ul>
</li>
</ul>
</nav>
</h2>
<p>
</p>
Meer over Handelsartikelen
</div>
</li>
<li>
<div class="icon">
<a href="producten/veevoer/" title="Veevoer">
<img src="/i/overview/veevoerwb.png" alt="Veevoer">
</a>
</div>
<div class="text">
<h2>
<nav>
<ul>
<li>
<a href="producten/veevoer/" title="Veevoer">
Veevoer
</a>
<ul>
<li>
<a href="#" title="lorem">
</a><ul><li class="first">pietjes eten</li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</h2>
<p>
</p>
Meer over Veevoer
</div>
</li>
<li>
<div class="text">
<h2>
<nav>
<ul>
<li>
<a href="diensten" title="Diensten">
Diensten
</a>
<ul>
<li>
<a href="#" title="lorem">
</a>
</li>
</ul>
</li>
</ul>
</nav>
</h2>
<p>
</p>
Meer over Diensten
</div>
</li>
</ul>
</div>
</div>
There are a variety of solutions, I've paired back your code a little to make the solution a little clearer, but have a look at this
http://codepen.io/dave_agilepixel/pen/cDtLk
I wouldn't repeat the item, or have the wrapper around the if you can avoid it, if you need the h2 for styling then use css or change the code to something like
<nav>
<ul>
<li><h2>Object</h2></li>
</ul>
</nav>
Also with the icons it might be easier to have those as CSS background images and use padding/background-position to set them in the design.
I hope that helps, in my example I've used position absolute and left to get the sub menu to work, but you could use display:none; or some other methods, if you use a combination of opacity and top then you can also add in css3 transitions to make it look jazzy.
I am having a issue with getting my bootstrap to work with a site I am designing for a friend.
<nav class="navbar navbar-static-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="/" style="width: 240px;">
West Coast Refuse Trucks
</a>
<div class="nav-collapse">
<ul class="nav">
<li>
<a href="index.html" class="active">
Home
</a>
</li>
<li>
<li>
<a href="about.html">
About
</a>
</li>
<li>
<a href="firstgear.html">
First Gear
</a>
</li>
<li>
<a href="/play">
Uploads
</a>
</li>
<li>
<a href="/forums">
Refuse Community
</a>
</li>
</ul>
</div>
</div>
</div>
</nav>
I am not sure what is preventing it from highlighting in my page on my site. Home shows up as usual. Any help?
Assuming that you are using Bootstrap 2.3.2, you suppose to add active class to <li>, not to <a>.
<ul class="nav">
<li class="active">
Home
</li>
<!-- ... -->
</ul>
Demo: http://bootply.com/97634
I am working off a template to play around with codes and am having difficulty in getting the "Template Store" link to work.
Please can you help me solve this problem as nothing currently happens when clicked.
Update:
Here is a link to my website - http://www.graphixinc.co.za/test/index.html. I'm using target = _blank here, but it isn't working.
Here is the code:
<div class="navigation">
<img src="images/navigate.png" alt="navigate_img"/>
<ul>
<li>
<span>Take Me Home</span>
</li>
<li>
<span>Template Store</span>
</li>
<li>
<span>About</span>
</li>
<li>
<span>Services</span>
</li>
<li>
<span>Portfolio</span>
</li>
<li>
<span>On Promo</span>
</li>
<li>
<span>News</span>
</li>
<li>
<span>Contact Us</span>
</li>
</ul>
</div>
Your help is much appreciated.
That's because target="blank" should be target="_blank"
<span>Template Store</span>
target should be "_blank" and i tested it...
<span>Template Store</span>
here is the fiddle for it, it works fine...