Solved

Image insert seems to add an unwanted space between images

Posted on 2009-05-06
13
195 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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: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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

809 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