Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Vertical Nav Question (CSS)

Featured Replies

I'm creating a site for my artwork and I need to know how to move the text inside of a vertical nav bar.

 

I've attached a pic showing what I have atm - I just need to know how to move the text itself inside the grey boxes using HTML/CSS. Help would be greatly appreciated :)

 

 

post-18260-0-35492300-1309996701_thumb.png

Use paddings, margins or positioning.

Use a list element:

 

Something like this:

 

XHTML

<ul class="side_nav">
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li><a href="#">Link 3</a></li>
</ul>

CSS

ul.side_nav {
  list-style:none;
  margin:0;
  padding:0;
  width:200px;
}

ul.side_nav li  {
  margin:0;
  padding:4px 10px;
  background:#ccc;
  display:block;	
}

ul.side_nav li a {
  color:#333;
  font-weight:normal;	
  padding:0;
}

 

EDIT: quickly lifted from my standard css stuff, so your mileage may vary.

You'll get the idea however - set the unordered list to have no list-style (no bullet on the li tags), set it's margin and padding to 0.

Then do the same to the li, add some padding to it.

Finally, create the link style.

 

It should be noted that you can mix 'n match the styles in the link and the li - you could set the link to a display of block and put the padding on that.

 

You can seperate the items in the list either by putting top/bottom margin on the li element, or putting borders on it - the sky is the limit.

 

However, the above code is a *very* standard way of doing a basic vertical list. From this base, you can go wild with the styling, add background arrow images to your links, rounded corners, gradients - whatever you want.

Edited by bb_matt

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.