Solved

Image insert seems to add an unwanted space between images

Posted on 2009-05-06
13
193 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
Comment Utility
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
Comment Utility
Can you show us what's arround this div?
0
 
LVL 10

Expert Comment

by:cdebel
Comment Utility
are you using style sheets? themes?
0
 
LVL 41

Expert Comment

by:guru_sami
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 10

Expert Comment

by:cdebel
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
*On one line* not one like hehe,
0
 

Author Closing Comment

by:cassiec
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

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…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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 the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

763 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

10 Experts available now in Live!

Get 1:1 Help Now