Solved

Image insert seems to add an unwanted space between images

Posted on 2009-05-06
13
198 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: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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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.
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

733 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