473,396 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Background image in <a> element does not wrap in IE-6.

Hello everyone,

I have a slight problem that I can't seem to solve. I'm not sure if it's a
CSS problem, HTML problem or simply an IE-6 bug. I chose this forum as I
suspect the fix may be with CSS.

I have styled hyperlinks on a website to show a small "new window" icon when
I have a link that opens in a new window. This works as designed in FF. In
IE-6, however, when a hyperlink wraps to the next line, the icon does not
wrap along with it, it get stuck on the first line. You can see a screenshot
of the problem here (with red arrow pointing to the problem):

www.vikenk.com/screenshot.jpg

You can see the website here if you want to check the problem out for
yourself: www.sayatnova.com

Here's my hyperlink style (with commentary):

a:link { color: #0099ff }
a:visited { color: #ff8000 }
a:hover { color: #ff0000; text-decoration: none }
a:active { color: #ff0000 }
a.newwin {
background-image: url('../images/new_window_current.gif');
background-repeat: no-repeat;
background-position: right center;
padding-right: 14px; (makes space for the icon image)
margin-right: 5px; (allows a little bit of space before the next word so
it doesn't look so crowded)
text-align: left;
}

I've tried to solve it by adding "white-space: nowrap" and other white-space
options to the style, but it hasn't worked. Again, it works fine in FF. I'm
not sure how to solve the problem.

Can anyone suggest any fixes? Thanks in advance!

--
Viken K.
http://www.vikenk.com

Jan 2 '08 #1
1 3459
OK, I had a long-distance friend give me a tip and solved the problem. I
added the following to my style:

display: inline-block;

Problem solved - works in IE-6, IE-7, FF and Opera.

--
Viken K.
http://www.vikenk.com
"Viken Karaguesian" <vikenkNO_SPAM@NO_SPAMcomcast.netwrote in message
news:9t******************************@comcast.com. ..
Hello everyone,

I have a slight problem that I can't seem to solve. I'm not sure if it's a
CSS problem, HTML problem or simply an IE-6 bug. I chose this forum as I
suspect the fix may be with CSS.

I have styled hyperlinks on a website to show a small "new window" icon
when I have a link that opens in a new window. This works as designed in
FF. In IE-6, however, when a hyperlink wraps to the next line, the icon
does not wrap along with it, it get stuck on the first line. You can see a
screenshot of the problem here (with red arrow pointing to the problem):

www.vikenk.com/screenshot.jpg

You can see the website here if you want to check the problem out for
yourself: www.sayatnova.com

Here's my hyperlink style (with commentary):

a:link { color: #0099ff }
a:visited { color: #ff8000 }
a:hover { color: #ff0000; text-decoration: none }
a:active { color: #ff0000 }
a.newwin {
background-image: url('../images/new_window_current.gif');
background-repeat: no-repeat;
background-position: right center;
padding-right: 14px; (makes space for the icon image)
margin-right: 5px; (allows a little bit of space before the next word so
it doesn't look so crowded)
text-align: left;
}

I've tried to solve it by adding "white-space: nowrap" and other
white-space options to the style, but it hasn't worked. Again, it works
fine in FF. I'm not sure how to solve the problem.

Can anyone suggest any fixes? Thanks in advance!

--
Viken K.
http://www.vikenk.com

Jan 6 '08 #2

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

Similar topics

4
by: Csaba2000 | last post by:
I want to be able to programatically click on the center of an <INPUT type=image ...> element (I only care about IE 5.5+). This should work regardless of whether IE has focus. Normally you would...
3
by: lostinspace | last post by:
I'm hoping somebody here might help with recall of a URL. Twice in the past week I have looked at a page that was provided as an example on how to automatically wrap multiple images to the next...
2
by: Dan V. | last post by:
Why does the banner image wrap around when I choose a small window size? http://officeactivate.com/schuit/index.shtml I am 1/2 way done a css book and am using this code from a CSS generator....
2
by: John | last post by:
The following code works OK in IE 6.0 but does not work in Netscape 7. The image does not shift when one scrolls down but stays stationary in Netscape. Please help Thank you John function...
3
by: Frank Wein | last post by:
Hi, today i found out some browsers (at least Mozilla and IE) support the <image> tag, its usage seems to be the same as for the <img> tag (IMDB.com uses it for example). I did not find anything...
3
by: jackiepatti | last post by:
QUESTION: I have a web page containing a form that contains an image instead of a submit button, e.g. <form name='myform' action='get' method='otherpage.asp'> <input type='image'...
3
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt,...
5
parshupooja
by: parshupooja | last post by:
Hey All, I m using asp.net I have image control on page and I want to load image in it but image does not resides in root of application instead it is on C drive. This is the path ...
5
by: Jeff | last post by:
hi asp.net 2.0 I get this compile error: 'Image' does not contain a definition for 'ImageUrl' Image image = (Image)e.Item.FindControl("img"); image.ImageUrl = "~/image.png";
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.