?
Solved

Image insert seems to add an unwanted space between images

Posted on 2009-05-06
13
Medium Priority
?
202 Views
Last Modified: 2013-11-08
Hello everyone....

net 3.5 sp1 vs 2006  IE 7.0

Cant figure this out..
Image insert seems to ADD a space between images - intefers with formating

ie:
<div>
<asp:Image ID="Image19" runat="server" AlternateText="" ImageUrl="~/Images/1.jpg" />
                 <asp:Image ID="Image20" runat="server" AlternateText=""  ImageUrl="~/Images/2.jpg" />
</div>

I have tried adding "" as alternative text to see if that helps but it does not.
What can I do to align the images next to each other in a single line in a DIV
I have tried gifs and jpeg - it does the same with both

Thanks


0
Comment
Question by:cassiec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +3
13 Comments
 
LVL 10

Expert Comment

by:Christian de Bellefeuille
ID: 24320894
Does theses images can fit in your browser without going on another line?  Because it should work.

I've tried it and they appear next to each other.  One of my picture is smaller (height) than the other one, and they both seems to be aligned from the bottom of the pictures.
0
 
LVL 10

Expert Comment

by:Christian de Bellefeuille
ID: 24320915
Can you show us what's arround this div?
0
 
LVL 10

Expert Comment

by:Christian de Bellefeuille
ID: 24320954
are you using style sheets? themes?
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 41

Expert Comment

by:guru_sami
ID: 24320959
not sure if i got that right ..
did you try setting padding or margin to 0px for div...
0
 
LVL 8

Expert Comment

by:ApexCo
ID: 24320961
So you are dumping these in automatically? Have you tried adding a cssclass with a float:left to your parent div?

You might also format the image control with a cssclass as well.
0
 
LVL 1

Expert Comment

by:CJMilner
ID: 24321053
I think this is an issue with IE7 registering the whitespace. Try using this mark up
<div>
<asp:Image ID="Image19" runat="server" AlternateText="" ImageUrl="~/Images/1.jpg" /><asp:Image ID="Image20" runat="server" AlternateText=""  ImageUrl="~/Images/2.jpg" />
</div>

Open in new window

0
 
LVL 10

Expert Comment

by:Christian de Bellefeuille
ID: 24321112
i'm using IE7 and i don't have this issue.  But if it would become an issue,  he could add only "&nbsp;" after his first image and it would be ok.  I suspect that he is using some formatting somewhere else (style sheet, themes), but since he just shown his div tag...   we have to wait for his answer.
0
 
LVL 9

Expert Comment

by:AsishRaj
ID: 24322293
try putting

BorderStyle="None"

and see how you have formated your page
Align="Center" Or Align = "Justified"

error is not associated with your image placement but instead it is with the formatting of the page.
0
 

Author Comment

by:cassiec
ID: 24323585
Hi Guys
Thanks for all your help......

I have found a SIMPLE solution but requires <asp:image ,..... /> tags to be place immediately following each other.. ie: do not place your <asp:image tags on a new line in your code..... but rather next to each other in the same line while using source code.

Normally when I was coding in source view I would place the <asp:image  tage on new lines (by hitting enter key)... to make code more readable...... and for some reason this action inserts a space..

NOW, my question is can this be overcome.. as I like to make the code readable by having each tag on a newline in source code ?????

Any comment on how I can keep my tags on new lines (and hence easier to read) without this effect  once displayd in browser - by the way I have tried ptting altText = "" it has no effect.?

Any ideas ?


0
 
LVL 1

Accepted Solution

by:
CJMilner earned 2000 total points
ID: 24323691
Thought it might be that, glad you got that sorted.

If it's just a question readability why not just comment the code with a note

Ex:
<!-- Image 19 / 20 on one like, correct unnecessary IE whitespace -->
0
 
LVL 1

Expert Comment

by:CJMilner
ID: 24323693
*On one line* not one like hehe,
0
 

Author Closing Comment

by:cassiec
ID: 31578779
I will proceed with the solution which is to add a comment to make a note that it is required for readability,

But I really do think there should be some codie solution to this... ah.. what minor problems seem to frustrate us !!!!

Thanks all for the various ideas...
Thanks
0
 
LVL 10

Expert Comment

by:Christian de Bellefeuille
ID: 24325237
CASSIEC: It seems that you already accepted the answer, wipping experts solutions with your hand.

But anyway... read my previous comments and you will find code for your readability!  (Comment #24321112)

But as i said, YOU HAVE SOMETHING ELSE OUTSIDE YOUR DIV CAUSING THIS PROBLEM.
Something like <P>... but Whatever...
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question