DotDragnet
February 07, 2012, 02:57:15 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: follow us on twitter @dotdragnet
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: css list - inline height  (Read 6950 times)
SLEE
Hero Member
*****
Posts: 816



View Profile WWW Awards
« on: June 21, 2007, 11:10:04 AM »

ive got a list that ive made display inline so they are in a line.
is there a way to force the <a> tag to the correct height (20px)?
i cant float them as the ordering of the menu will be wrong.

here is my css:

Code:
#top #menu li{
display:inline;
list-style-type:none;
margin:0;
padding:0;
}


#top #menu a:link, #top #menu a:visited, #top #menu a:active{
color:#000099;
font-size:11px;
text-decoration:none;
padding: 10px 10px 5px 10px;
background-color:#CCCCCC;
border-left:1px solid #ffffff;
text-align:center;
display:block;
}

help  Sad
Logged

SLEE - still the most confusing ddner...

Follow me on Twitter
Mr Anderson
DDN Contribs
Hero Member
*****
Posts: 2212



ap4a.uk ap4a
View Profile WWW Awards
« Reply #1 on: June 21, 2007, 11:26:25 AM »

ive got a list that ive made display inline so they are in a line.
is there a way to force the <a> tag to the correct height (20px)?

Line-height or padding.

Quote
i cant float them as the ordering of the menu will be wrong.

Floating left won't change the order of floated elements.
Logged

SLEE
Hero Member
*****
Posts: 816



View Profile WWW Awards
« Reply #2 on: June 21, 2007, 02:13:27 PM »

the line height worked smile but im getting a gap between each item. it seems to be the li but i cant see what it could be.

Code:
#top #menu{
position:absolute;
top:67px;
right:0px;
height:30px;
width: 640px;
text-align:right;
}

#menu li{
display:inline;
}

#top #menu a:link, #top #menu a:visited, #top #menu a:active{
color:#000099;
font-size:11px;
text-decoration:none;
padding: 5px 10px 5px 10px;
background-color:#CCCCCC;
border-left:1px solid #ffffff;
height:20px;
text-align:center;
margin-top:5px;
line-height:50px;
}

re the ordering ok technically you are right as it doesnt change the order but it means the the first list item is on the right. i guess itjust stacks them differenty is a better explanation. smile
Logged

SLEE - still the most confusing ddner...

Follow me on Twitter
Mr Anderson
DDN Contribs
Hero Member
*****
Posts: 2212



ap4a.uk ap4a
View Profile WWW Awards
« Reply #3 on: June 21, 2007, 02:19:41 PM »

the line height worked smile but im getting a gap between each item. it seems to be the li but i cant see what it could be.

More info required (preferably in the form of a link to somewhere I can see the problem), but - what browser(s)? Gap where?

Quote
re the ordering ok technically you are right as it doesnt change the order but it means the the first list item is on the right

That will only happen if you float them to the right, which your initial post gave no indication of being the case. Your latest shows that you've added text-align: right; to right align things, which means my earlier comment is irrelevant.
Logged

SLEE
Hero Member
*****
Posts: 816



View Profile WWW Awards
« Reply #4 on: June 21, 2007, 02:35:22 PM »

ive been messing with the code so ive added and taken all bits of css in and out.
here is a screenshot of the problem:



you can see there is a gap between each list item.

thanks for the help smile
Logged

SLEE - still the most confusing ddner...

Follow me on Twitter
Mr Anderson
DDN Contribs
Hero Member
*****
Posts: 2212



ap4a.uk ap4a
View Profile WWW Awards
« Reply #5 on: June 21, 2007, 02:41:30 PM »

I can't see it there so check your default margins and padding settings - have you overridden the browser defaults or not? What margins and padding is being applied to list items?
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!