This is a discussion on "Help With Display: Block Vertical Spacing Please" within the Web Page Design section. This forum, and the thread "Help With Display: Block Vertical Spacing Please are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
Help With Display: Block Vertical Spacing Please
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Help With Display: Block Vertical Spacing Please
I'm currently helping out a guy customise his shopping cart template. It's going fine but it was previously done by another guy who's left everything in a mess, everything uses tables which I don't use etc etc
It can be seen here http://gbfitness.net/uq/default.asp The problem I have is with the menu on the left. The way I currently have it it displays perfect in Firefox, but in IE has too much vertical spacing. I'd tried using position: realtive and using a negative top margin but it won't seem to work. If I take off the display: block and play around a bit more I can get it to work fine in IE, but in Firefox the widths don't work, the background only goes as wide and long as the text is. Has anyone please got any suggestions so this will work in both browsers please? It's driving me crazy! Here's the CSS code: A.prodtypemenu1:link {display: block; float:left; margin-top:5px; padding:0px; text-decoration: none; color: #f5f5f5; font-weight:bold; font-size:13px; height: 18px; width:130px; background-color: red; border: solid 1px; border-color: red;} A.prodtypemenu1:visited {display: block; float:left; margin-top:5px; padding:0px; text-decoration: none; color: #f5f5f5; font-weight:bold; font-size:13px; height: 18px; width:130px; background-color: red; border: solid 1px; border-color: red;} A.prodtypemenu1:hover {display: block; float:left; text-decoration: none; margin-top:5px; padding:0px; color: red; font-weight:bold; font-size:13px; height: 18px; width:130px; background-color: #f5f5f5; border: solid 1px; border-color: red;} A.prodtypemenu2:link {display: block; float:left; padding:0px; text-decoration: none; color: red; width:130px; margin-top:-10px; background-color: #f5f5f5; border: solid 1px; border-color: red;} A.prodtypemenu2:visited {display: block; float:left; padding:0px; text-decoration: none; color: red; width:130px; margin-top:-10px; background-color: #f5f5f5; border: solid 1px; border-color: red;} A.prodtypemenu2:hover {display: block; float:left; padding:0px; text-decoration: none; color: #f5f5f5; width:130px;margin-top:-10px; background-color: red; } |
|
|
|
#2
|
||||
|
||||
|
Re: Help With Display: Block Vertical Spacing Please
Strangely, adding "height:100%;" to which ever style also has the "display:block;" usually fixes that well known error.
I hate that browser. |
|
#3
|
|||
|
|||
|
Re: Help With Display: Block Vertical Spacing Please
Thanks but sadly that didn't work, if I put height: 100% in, it makes no difference in IE, and makes the button 100% of the table it's in in FF :S anymore suggestions please?
|
|
#4
|
||||
|
||||
|
Re: Help With Display: Block Vertical Spacing Please
The code you've given seems to me to be correct. I plugged it into another site and it worked fine.
I'm guessing the problem lies somewhere else in the code, possibly an inherited feature. What do you have for the ul? |
|
#5
|
|||
|
|||
|
Re: Help With Display: Block Vertical Spacing Please
I've just looked at the CSS again, the UL isn't set as anything - I tried changing it to Height: 0px but it still makes no difference.
Here's the entire CSS sheet if it helps (yes I know it's a complete mess, I'm taking over from someone elses shoddy work)
Thanks, this is really starting to irritate now that I can get it ok in EITHER FF or IE, but not both Last edited by herkalees; Jun 13th, 2006 at 00:41. |
|
#6
|
||||
|
||||
|
Re: Help With Display: Block Vertical Spacing Please
I've never worked with tables to structure a webpage so I don't know how things work. The tables I've done have always behaved.
I will give you an approach, which may or may not be right. If someone hasa definitie solution, just ignore it, LOL. I do note that <SPAN class=smallnormal> doesn't have quotes around the class name. It might be that you are getting different font reactions from different browsers. I don't see how this would be 100% of your problem, but leaving code like that is just asking for bugs. Take out all the margins and padding, which will help you analyze the problem. Change the spans to divs and try to add padding and margin to different elements. |
|
#7
|
|||
|
|||
|
Re: Help With Display: Block Vertical Spacing Please
Thanks for your help, I've sorted it now, it was the span instead of using a div, coupled with width problems for the content. As I said I've taken this on from another web designer - shame he's a complete tool when it comes to coding, you wouldn't believe the mess I've got to work with! Thanks again
|
![]() |
| Tags |
| help, display, block, vertical, spacing |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Overriding display:inline-block | gazzou | Web Page Design | 0 | Aug 27th, 2007 12:03 |
| Display:Block in IE | sparadox | Web Page Design | 4 | Jul 25th, 2007 19:30 |
| div spacing | johnnybravo | Web Page Design | 13 | Sep 6th, 2006 12:06 |
| display:block | benbacardi | Web Page Design | 20 | Jul 30th, 2004 16:08 |
| display:block | benbacardi | Web Page Design | 4 | Apr 21st, 2004 19:40 |