472,961 Members | 1,518 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,961 software developers and data experts.

Position of <a> inside <li> in a styled navigation <ul>

I'd welcome some help in understanding what's going on with graphical
browsers in the navigation list at:

http://www.bounceandtickle.org.uk/index.html

(This site is not about what it might seem from the URL!)

I'm using a <ul> for the gimmicky teddy bear links. The teddy is a
background image for each <li>. Each link 'button' is an <a> within an
<li>, and I'm trying to get the button to appear partway down the teddy
image, as if the teddy is holding the button.

WinIE6 displays this correctly, where 'correctly' means 'shows the
effect I'm after.' However, Firefox and Opera no doubt do what I'm
telling them and display a button at the top of each <li>, and have a
large spacing between each teddy/button.

However, if I set a border on each <li> all three browsers display the
list near enough the same and in just the way I'm trying to achieve.
I've currently commented out the line border: 1px solid #FFA500; (where
the colour is the same as the body background) to show the difference in
rendering.

Both the HTML and the CSS validate. The CSS is at:

http://www.bounceandtickle.org.uk/styles.css

It's not very optimised at the moment so I've moved the <li> and related
styling to the start of the file.

I understand neither the difference in browser rendering without the
border nor why the border makes a difference. Can anyone help?

Andrew
Aug 15 '05 #1
2 2482
Andrew Donaldson wrote:

http://www.bounceandtickle.org.uk/index.html

I'm trying to get the button to appear partway down the teddy
image, as if the teddy is holding the button.

WinIE6 displays this correctly, where 'correctly' means 'shows the
effect I'm after.'

However, if I set a border on each <li> all three browsers display the
list near enough the same and in just the way I'm trying to achieve.


That's probably because of collapsing margins. Google for more info on
this subject.

If you set padding-top:1px on the li element, you should get the effect
you want in browsers other than IE.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
Aug 16 '05 #2
kchayka wrote:
Andrew Donaldson wrote:
[unexpected position of one element within another]
That's probably because of collapsing margins. Google for more info on
this subject.
I know of collapsing margins but clearly my understanding is incomplete.
I'll check the specs.
If you set padding-top:1px on the li element, you should get the effect
you want in browsers other than IE.


You're exactly right. Thank you.

Andrew
Aug 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: bearclaws | last post by:
I am looping through a list of categories and want to display the list horizontally (instead of vertically). I want to create a single row with 4 list items in each cell of the row. I thought...
8
by: Michael | last post by:
This is a two-part question to which I haven't been able to find an answer anywhere else. 1. Is it possible to format the bullet/number character of the <li>? In my styles sheet, I have the <li>...
5
by: toylet | last post by:
Attached is some css codes for a website. It has 3 parts: top-bar, side-bar (on the left) and main-body. The top-bar has a mouseover menu called top-menu implemented via ul:hover. When the mouse...
4
by: Matt | last post by:
Hi, Got an unordered list with 100% width, with 5 list items of 20% width styled to fill the width of the container element. Renders fine in Mozilla, but when you change the size of the window...
4
by: Viken Karaguesian | last post by:
Hello all, I'm have an annoyance I can't seem to solve. I'm working on a website that has a sidebar floating to the right. In the sidebar is an unordered list. In IE and in Opera, the list shows...
5
by: Syl | last post by:
Hello experts!! The top menu navigation bar displays perfectly in IE, but does not display properly in Mozilla or Netscape : http://checkeredshirt.com/textonly.html For some reason the non-IE...
7
by: patrick j | last post by:
Hi I'm wondering about lists with nested lists as one does on a Saturday afternoon. Anyway below is an example of a list with a nested list which the iCab browser's very useful HTML...
2
by: GloStix | last post by:
For some reason, FF likes to put a black underline on all my buttons. No matter what I do, it has the line I've tried displaying as block and cursor, anything.. Also I've been trying to get it so...
2
by: Shahid | last post by:
Hi, I am parsing an .HTML file that contains following example code: <div> <p class="html_preformatted" awml:style="HTML Preformatted" dir="ltr" style="text-align:left"><span...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.