473,486 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

vertical alignment on ul/li bullet image

hi,
I am writing a simple bulleted list with ul/li, with my image as the
list-style-image, and for some reason the image bullet on IE only (FF
is fine) is vertically aligned to the top.
Meaning, the bullet image is aligned to the TOP of the text following
it.
In FF the image is aligned to the center of the text following it, as
it should.
What am I doing wrong?
ul {
list-style-image: url(/Images/arrow.gif);
list-style-position: inside;
margin: 0px;
padding: 0px;
}

li {
margin: 0;
margin-top: 0.3em;
padding: 0px;
}

I tried to add vertical-align: bottom, but nothing helped.
Any ideas?

Thanks, Gabi.

Aug 2 '06 #1
4 41775
Rik
Gabriella wrote:
hi,
I am writing a simple bulleted list with ul/li, with my image as the
list-style-image, and for some reason the image bullet on IE only (FF
is fine) is vertically aligned to the top.
Meaning, the bullet image is aligned to the TOP of the text following
it.
In FF the image is aligned to the center of the text following it, as
it should.
What am I doing wrong?
ul {
list-style-image: url(/Images/arrow.gif);
list-style-position: inside;
margin: 0px;
padding: 0px;
}

li {
margin: 0;
margin-top: 0.3em;
padding: 0px;
}

I tried to add vertical-align: bottom, but nothing helped.
Any ideas?
I'm not sure wether this it's possible to set the position in the different
browsers. I haven't found a method for this.

Possible workaround (untested):
ul {
margin: 0px;
padding: 0px;
}
li{
list-style-type: none;
margin: 0.3em 0 0 0;
padding-left: 10px; /* or whatever you need for you image */
background-image: url(/Images/arrow.gif);
background-position: left top; /* or replace 'top' with the appropriate
em value */
background-repeat: no-repeat;
}

Grtz,
--
Rik Wasmus
Aug 2 '06 #2
On 2 Aug 2006 00:40:47 -0700, "Gabriella" <fr********@yahoo.com>
wrote:
>hi,
I am writing a simple bulleted list with ul/li, with my image as the
list-style-image, and for some reason the image bullet on IE only (FF
is fine) is vertically aligned to the top.
Meaning, the bullet image is aligned to the TOP of the text following
it.
In FF the image is aligned to the center of the text following it, as
it should.
What am I doing wrong?
ul {
list-style-image: url(/Images/arrow.gif);
list-style-position: inside;
margin: 0px;
padding: 0px;
}

li {
margin: 0;
margin-top: 0.3em;
padding: 0px;
}

I tried to add vertical-align: bottom, but nothing helped.
Any ideas?

Thanks, Gabi.
Hi Gabi,

I wrestled with the same problem and my solution (modified for your
example) was:

ul {
list-style-type: none;
padding: 0em;
margin: 0em;
}

ul li {
background-image: url(Images/arrow.gif);
background-repeat: no-repeat;
background-position: 0em .4em;
padding-left: 1em;
}

Note that the image is set to the li not the ul.

Hope this is a guide for you!!

Andrew.

--

Andrew
http://www.andrews-corner.org/
Aug 2 '06 #3
Thanks, it solved the problem, but created a new one...
Now, when trying to add dynamically an entry to the list, using the
following code:

var myList = document.getElementById("my-list");
var newLiElement = document.createElement('li');
newLiElement.id = "new-entry";
myList.appendChild(newLiElement);

var innerHTML = "&nbsp;<a href="...">[remove from
list]</a>"
document.getElementById("new-entry").innerHTML = innerHTML;

A new entry (new li element) is created but WITHOUT the bullet image
(the arrow.gif).
Before, it did add the bullet image.
Why did it disappear?

Thanks again, Gabi

Aug 2 '06 #4
On 2 Aug 2006 14:20:30 -0700, "Gabriella" <fr********@yahoo.com>
wrote:
>Thanks, it solved the problem, but created a new one...
Now, when trying to add dynamically an entry to the list, using the
following code:

var myList = document.getElementById("my-list");
var newLiElement = document.createElement('li');
newLiElement.id = "new-entry";
myList.appendChild(newLiElement);

var innerHTML = "&nbsp;<a href="...">[remove from
list]</a>"
document.getElementById("new-entry").innerHTML = innerHTML;

A new entry (new li element) is created but WITHOUT the bullet image
(the arrow.gif).
Before, it did add the bullet image.
Why did it disappear?

Thanks again, Gabi
Hi Gabi,

So quickly I get out of my depth! Sigh........... You will need
someone cleverer than me for this one.

Sorry,

Andrew
--

Andrew
http://www.andrews-corner.org/
Aug 3 '06 #5

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

Similar topics

7
7090
by: Nikolaos Giannopoulos | last post by:
I have a paragraph and simply want a bullet image to appear at the start of the paragraph text. I tried the following html: <p><span class="dot"></span>some text</p> as seen here:...
8
30870
by: abracad | last post by:
Hi Is it possible to vertically align an image in the middle of a DIV of fixed height?
3
4272
by: Frank Wheeler | last post by:
Why am I unable to attain proper vertical alignment between a DIV and a TABLE here: http://www.whbvillage.com/agenda-archives/agendex.html The DIV is coded: <DIV style="float: left;...
3
15635
by: cbjewelz | last post by:
hey I've been suffering from several float problems. I want a Title on the left to be aligned vertically with several links on the right. However with my code the Title is lower than the links....
2
6368
by: Nik | last post by:
I have a simplified version of my image gallery at: http://www.niksally.f2s.com/upload/gallery/mixed_gallery.html Essentially, the format of the html is an in-line list: <ul> <li><img></li>...
11
19178
by: C.W.Holeman II | last post by:
I what to hide an input element and the following text. I have the selector for the input working and just need to grab the text following it. CSS: form{ display:table; text-align:center; }
8
3519
by: ayamopamo | last post by:
Hi- I am trying to center a web page. It seems like this should be very simple to do, but apparently it isn't my day. I have successfully centered the background by calling it in the css body tag:...
3
3478
by: vunet | last post by:
When I use image as a bullet within LI element I have different image positioning results in Firefox and IE6. IE6 puts the image on top and far from left LI's border. Firefox puts it nicely in the...
0
1459
by: balistersharma | last post by:
How can set vertical alignment with RadioButtonList .so that the RadioButtonList and text show in the same alignment. I have used following syntax but this is not work as my requirement. ...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7305
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.