why are my links looking like this!?

This is a discussion on "why are my links looking like this!?" within the Web Page Design section. This forum, and the thread "why are my links looking like this!? are both part of the Design Your Website category.


 Subscribe in a reader

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

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Feb 18th, 2007, 03:01
Junior Member
Join Date: Oct 2006
Location: Denver
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
why are my links looking like this!?

http://home.comcast.net/~adamq/chapter07/links-nav.html

how come my links have the additional spacing below each a element..when I setup display:block it appears! I cant figure out why Im getting this to look this way..it looks fin ein firefox but of course in IE6 it doesn';t look right. what am I missing..??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Feb 18th, 2007, 03:05
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

Add height: 1px; to #nav-list a {

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css" media="all">
* {
    padding: 0;
    margin: 0;
}
body {
    font: 100% Arial, Helvetica, sans-serif;
}
#nav-list {
    font-size: .80em;
    list-style-type: none;
    margin: 0;
    padding: 2px;
    border: 1px solid #333;
    width: 160px;
}

#nav-list a {
    text-decoration: none;
    background: #FFFFCC;
    display: block;
    padding: 2px 5px;
    height: 1px;
}
</style>
</head>

<body>
<ul id="nav-list">
  <li><a href="#">Star Wars</a></li>
  <li><a href="#">Empire Strikes Back</a></li>

  <li><a href="#">Return of the Jedi</a></li>
  <li><a href="#">Prequel News</a></li>
  <li><a href="#">Contact Us</a></li>
  <li><a href="#">Links</a></li>
</ul>
</body>
</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Feb 18th, 2007, 05:56
Reputable Member
Join Date: Jul 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

This is a bug in IE where it adds the space after the /li closing. Something about seeing a return. I'd have to search again to find the full bug explanation.

Like karinne suggested, adding the height attribute fixes it. I believe adding a width also fixes it.

Changing the code to the below layout will also fix it without having to add the height or width attribute.
Code: Select all
<ul id="nav-list"><li>
 <a href="#">Star Wars</a></li><li>
 <a href="#">Empire Strikes Back</a></li><li>
 <a href="#">Return of the Jedi</a></li><li>
 <a href="#">Prequel News</a></li><li>
 <a href="#">Contact Us</a></li><li>
 <a href="#">Links</a></li></ul>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Feb 18th, 2007, 07:16
Junior Member
Join Date: Oct 2006
Location: Denver
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

the problem with doing that is it screws up the the way the links look in firefox...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Feb 18th, 2007, 18:15
Junior Member
Join Date: Oct 2006
Location: Denver
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

the problem I have with the last posting is we are changing semantic markup into invalid markup. id prefer to leave the markup as is and apply 1px height.

so other browsers does not see this, I used the * html so the rule only is seen by IE. thanks for all your postings.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Mar 18th, 2007, 08:09
Reputable Member
Join Date: Jul 2005
Posts: 400
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

Changing semantic markup in to invalid markup... huh? All this does is move the <li> to the previous line. Makes no difference whatsoever semantically. And both IE and FF look exactly the same when done this way.

Adding a height and using the * are both hacks.

I think IE7 corrected this issue which means any site using the height hack will see jumbled vertical links. I need to do more testing in IE7 to make sure of this though.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Mar 19th, 2007, 14:28
Junior Member
Join Date: Oct 2006
Location: Denver
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

i didnt mean to confuse semantic with valid markup, those are two different things. I meant i was afraid that by doing that as posted above as far as changing the li, it would produce invalid markup when I tried to validate the document.
whats so suprising to me is none of the CSS books I hvae read so far speaks to this issue in IE6 so I was suprised it didn't work.
thanks again.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Mar 19th, 2007, 14:47
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

So ... did you try the solution I offered? Adding the height: 1px; to #nav-list a { ? Because ... that works and is a solution found everywhere.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Mar 19th, 2007, 15:21
Junior Member
Join Date: Oct 2006
Location: Denver
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

Yes, I did and it worked. Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Mar 19th, 2007, 15:26
Elite Veteran
Join Date: Jan 2007
Location: You know where
Age: 31
Posts: 4,617
Thanks: 0
Thanked 0 Times in 0 Posts
Re: why are my links looking like this!?

Ok ... no problem! I was just confused there with the last few posts!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Mar 19th, 2007, 17:26
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: why are my links looking like this!?

IE adds extra spacing when you make a styled vertical list, a workaround is width:100%; on the li's in your css.
__________________

Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
style

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
PR4 links for sale...links in an excellent position agent14 Link Building and Link Sales 4 Sep 19th, 2008 16:09
Msie doesn't make my links links.. delusion Web Page Design 7 Nov 7th, 2007 08:05
PR 5 Links available for recip links GARY Link Building and Link Sales 1 Aug 19th, 2006 09:52
Blured Links (image links) bruno89 Web Page Design 2 Jul 25th, 2006 14:48
Different coloured links without modifying links? Webforumz Staff Web Page Design 12 Aug 29th, 2003 18:48


All times are GMT. The time now is 17:24.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization 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