» » Use CSS3 to realize single-page vertical fixed navigation

 

Use CSS3 to realize single-page vertical fixed navigation

Author: bamboo06 on 6-10-2016, 11:56, views: 10678

19
More and more developers like to design a single page, especially a product introduction page, with each important part (node) of a page associated with a simple navigation bar. In this example, a page consists of several important nodes, the side of the page will show a number of simple vertical navigation far point, slide the dot will display the corresponding part of the node name, click on the page will scroll to the corresponding part of the node, While the navigation bar position is fixed.

When the screen is small enough (such as mobile devices), will display an icon in the lower right corner of the screen, touch icon, it will expand the navigation menu, click on the menu page will scroll to the corresponding node, the effect is very cool.

HTML
Our navigation bar is an unordered list ul, which is contained within the nav.cd-vertical-nav and is linked to the corresponding node by connecting a # section1. The element button.cd-nav-trigger is used as a button on the small-screen device to trigger the menu. Section.cd-section is used to correspond to the contents of the navigation node.
<nav class="cd-vertical-nav">
	<ul>
		<li><a href="#section1" class="active"><span class="label">Intro</span></a></li>
		<li><a href="#section2"><span class="label">Events</span></a></li>
		<li><a href="#section3"><span class="label">Help</span></a></li>
		<li><a href="#section4"><span class="label">Share</span></a></li>
	</ul>
</nav><!-- .cd-vertical-nav -->

<button class="cd-nav-trigger cd-image-replace">Open navigation<span aria-hidden="true"></span></button>

<section id="section1" class="cd-section">
	<div class="content-wrapper">
		<h1>Single-page vertical fixed navigation</h1>
		<p><a href="http://www.goocode.net/css/341-use-css3-to-realize-single-page-vertical-fixed-navigation.html">See the article</a></p>
		<a href="#section2" class="cd-scroll-down cd-image-replace">scroll down</a>
	</div>
</section><!-- cd-section -->

<section id="section2" class="cd-section">
	<div class="content-wrapper">
		<h2>Events</h2>
		<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto numquam, totam iusto officia earum perferendis, culpa ad atque eveniet praesentium nobis expedita similique beatae tenetur. Distinctio vel tenetur, id cum.</p>
	</div>
</section><!-- cd-section -->


CSS
Once the HTML structure is deployed, we need to add the necessary CSS styles to the page. In very small screen (view width less than 800px), we will. Cd-nav-trigger and

Category: CSS

Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.
<
  • 0 Comments
  • 0 Articles
31 July 2017 21:59

John Martin

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
That is a truly pleasant post. Online instruction plays an imperative part in advancing training among the majority Assignment Writing Help. The Education assumes an essential part in profession working and character working of the youths.

<
  • 0 Comments
  • 0 Articles
4 August 2017 03:08

Roberto Thompson

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Thankfully he was unharmed yet the harm to the auto was comprehensive and it detached him from the pursuit. Such a great quantity of valued to have streak news on propelling and the instructions predictable to custom dissertation writers. That data is familiar with assemble unbelievable informs and preps on this blog.

<
  • 0 Comments
  • 0 Articles
10 November 2017 03:02

Amelia

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
The Times is doing very good in everything and people should work for them. They write amazing custom essays and are very good at it. They know everything about it and are ahead of everyone.

<
  • 0 Comments
  • 0 Articles
10 December 2017 02:50

frank

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
CSS3 has helped me out on so many of my projects. I first learned about it when I went to buy the best drone gopro and from that day onwards, I knew I had to buy this software.

<
  • 0 Comments
  • 0 Articles
18 December 2017 21:23

brett

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
This is the kind of data I"ve long been attempting to discover. Much thanks to you for composing this data. cheap website traffic

<
  • 0 Comments
  • 0 Articles
20 December 2017 18:09

frank

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Thanks for the blog filled with so many information. Stopping by your blog helped me to get what I was looking for. Now my task has become as easy as. Play Tank Trouble

<
  • 0 Comments
  • 0 Articles
21 December 2017 01:12

charlie marks

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Coding looks quite amazing as i have checked it on w3schools and it would definitely help a lot to those who don't know any thing about HTML. I need a script for cordellacademicfoundation website and surely it would attract a lot of people. I am amazed to check your coding and your way of coding is quite different.

<
  • 0 Comments
  • 0 Articles
21 December 2017 03:14

carl

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I experience considerable difficulties my considerations on substance, yet I truly felt I ought to here. Your article is truly awesome. I like the way you composed this data. <a href="http://be4kfree.net/">watch full movie be4kfree.net</a>

<
  • 0 Comments
  • 0 Articles
21 December 2017 04:51

john

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Your work is very good and I appreciate you for doing great job and hoping for some more valuable posts! watch full movie be4kfree.net

<
  • 0 Comments
  • 0 Articles
24 December 2017 22:59

mellisa

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. florida pr firms

<
  • 0 Comments
  • 0 Articles
28 December 2017 23:08

Attiqa Shad

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
As we as a whole realize that in website design enhancement industry whatever substance as articles are accessible gone into article submission.
Article Submission guiding Visitors And Traffic

<
  • 0 Comments
  • 0 Articles
2 January 2018 04:29

niki

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Thanks for a wonderful share. Your article has importations your hard work and experience you have got in This field. Brilliant reading .I love it. pr release

Thanks so much with this fantastic new web site. I’m very fired up to show it to anyone. It makes me so satisfied your vast understanding and wisdom have a new channel for trying into the world. pr release

<
  • 0 Comments
  • 0 Articles
7 January 2018 18:11

frank

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. florida hospitality pr

<
  • 0 Comments
  • 0 Articles
7 January 2018 18:41

AprilHic

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
slots casino games
casino games online
<a href="http://casinobablogames.com/">free online slots</a>
free slots no download

<
  • 0 Comments
  • 0 Articles
10 January 2018 00:48

Soniahaw

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
online casino games
online casino real money
<a href="http://casinobablogames.com/">free casino slots</a>
freeslots

<
  • 0 Comments
  • 0 Articles
18 January 2018 02:53

sarah

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
Marvelous web journal. I appreciated perusing your articles. This is really an incredible read for me. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome! florida tech pr

<
  • 0 Comments
  • 0 Articles
22 January 2018 11:35

Mandygeowl

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
online slots
real money casino
<a href="http://casinobablogames.com/">casino games</a>
real money casino

<
  • 0 Comments
  • 0 Articles
8 February 2018 03:26

RolandBouff

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
casino games internet
<a href="http://onlineroulette.space/#">casino directory best bonus</a>
online casinos visa
online casino games using paypal
online casinos highest payout
<a href="http://online-casino.party/#">real live online roulette</a>
direct merchant bank gambling visa
software roulette
prime play online casino
<a href="http://online-slots.party/#">online casinos for us players</a>
slots games for android
real money online casino games
mobile games win real cash

<
  • 0 Comments
  • 0 Articles
20 February 2018 09:00

Gamerbolt

Reply
  • Group: Guests
  • РRegistered date: --
  • Status:
 
I think this is an informative post and it is very useful and knowledgeable.
That’s why, I would like to thank you for the efforts you have mad e in writing this article
<a href="https://www.gamerbolt.com"> Gamerbolt</a>

Information
Comment on the news site is possible only within (days) days from the date of publication.