Padding on inline navigation

This is a discussion on "Padding on inline navigation" within the Web Page Design section. This forum, and the thread "Padding on inline navigation are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 30th, 2007, 14:14
New Member
Join Date: Jul 2007
Location: norwich
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Padding on inline navigation

I'm having problems regrding applying top and bottom padding to the anchor element within an inline list. I wanted to place the horizontal navigation at the bottom right of the header. To do this, I made the header position:relative, and the topnav position:absolute with a bottom: 0 and float:right.
Code: Select all
#header {
position: relative;
height: 130px;
background: #8497c2;
background-image: url('header-bg.png');
background-repeat: no-repeat;
}

#topnav 
{
position:absolute;
bottom: 0;
font-size: 1.4em;

}

#topnav ul {
list-style: none;
background-color: #fffcd9;
margin: 0;
padding: 0px;
float: right;
font-family: 'Verdana', 'Helvetica', Sans-Serif;
border: none;
border-top: 1px solid #00267f;
border-right: 1px solid #00267f;
border-left: 1px solid #00267f;
}

#topnav li {
display: inline;
margin: 0;
}

#topnav a {
padding:0.8em;
font-weight: 300;
text-decoration: none;
}
I would like the buttons to be touching the base, and also have padding around the text. I also would like a rollover state. I figured this would mean applying 0 padding to anything except the <a> element. If I added padding to the ul or the li, then the whole button would'nt be affected on the rollover. The problem I'm having is that top padding and bottom padding do not seem to be having any effect on the a element and this I can't understand as I've had a look at the listamatic website at http://css.maxdesign.com.au/listamatic/ and many of horizontal examples have padding top and bottom applied in the same way I have.

Can anyone help me and explain why mine isn't working??

Thanks

Last edited by karinne; Jul 30th, 2007 at 14:33. Reason: Please use [ code ]...[ /code ] tags when displaying code.
Reply With Quote

  #2 (permalink)  
Old Jul 30th, 2007, 14:24
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Padding on inline navigation

Quote:
Originally Posted by mattblackuk2002 View Post
To do this, I made the header position:relative, and the topnav position:absolute with a bottom: 0 and float:right.
You can't apply float and positioning to the same element. They are mutually exclusive; if I recall correctly, the positioning will override the floating.

If you want it at the bottom right of the header, you could use:

Code: Select all
position: absolute;
bottom: 0;
right: 0;
Reply With Quote
  #3 (permalink)  
Old Jul 30th, 2007, 15:12
New Member
Join Date: Jul 2007
Location: norwich
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Padding on inline navigation

Thanks for that, but I have already tried that aswell but I still get the padding problem...
Reply With Quote
  #4 (permalink)  
Old Jul 30th, 2007, 15:14
New Member
Join Date: Jul 2007
Location: norwich
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Padding on inline navigation

Quote:
Originally Posted by MikeHopley View Post
You can't apply float and positioning to the same element. They are mutually exclusive; if I recall correctly, the positioning will override the floating.

If you want it at the bottom right of the header, you could use:

Code: Select all
position: absolute;
bottom: 0;
right: 0;
I didn't apply them both to the same element - I just explained it badly! The float was to the list inside the absolute div.
Reply With Quote
Reply

Tags
anchor, css, inline, navigation, padding

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inline elements and padding Kropotkin Web Page Design 2 Sep 6th, 2007 09:12
inline lists and rollovers Accurax Web Page Design 10 Mar 29th, 2007 01:27
Inline div Echilon Web Page Design 0 Feb 3rd, 2006 16:06
display inline ???? hessodreamy Web Page Design 3 Oct 8th, 2005 05:51


All times are GMT. The time now is 02:48.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43