This is a migrated thread and some comments may be shown as answers.

Country flag images in combo box take forever to load

3 Answers 409 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Chen
Top achievements
Rank 1
Chen asked on 14 Aug 2011, 10:22 PM
Hi,
I want to have a combo box for country flags, and have the ~240 countries listed with the ~240 flags.

When I use the ImageURL attribute, the loading of 240 flags takes forever as only a couple of requests are sent concurrently.

I have a sprite for flags, but cannot seem to separate the image from the text, i.e. if I use CSS and Background property, the text is placed on top of the flag.

Is there a way for me to show the flags in a combo box from a sprite, and have the text to the right of the flag?

Chen

3 Answers, 1 is accepted

Sort by
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 14 Aug 2011, 11:32 PM
Have you tried padding-left:20px (or whatever) to move the text over away from the flag?
0
Chen
Top achievements
Rank 1
answered on 14 Aug 2011, 11:40 PM
When I do that both the flag and text move.
In HTML they are both <li> and any padding I apply is applied to all of the <li>.
0
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
answered on 14 Aug 2011, 11:48 PM
Hmm if done right, it SHOULDN'T :/

Have a look at the attached image, I just quickly modified one of the demo pages

So the image becomes the background of the <li> and when the padding is set the test should be pushed over too
Tags
ComboBox
Asked by
Chen
Top achievements
Rank 1
Answers by
sitefinitysteve
Top achievements
Rank 2
Iron
Veteran
Chen
Top achievements
Rank 1
Share this question
or