Solved

Image insert seems to add an unwanted space between images

Posted on 2009-05-06
13
194 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
  • 5
  • 3
  • 2
  • +3
13 Comments
 
LVL 10

Expert Comment

by:cdebel
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:cdebel
ID: 24320915
Can you show us what's arround this div?
0
 
LVL 10

Expert Comment

by:cdebel
ID: 24320954
are you using style sheets? themes?
0
 
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 10

Expert Comment

by:cdebel
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 500 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:cdebel
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Find out what you should include to make the best professional email signature for your organization.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

920 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now