Solved

Internet explorer crlf, white space problem

Posted on 2009-05-13
9
365 Views
Last Modified: 2013-12-08
hi to all,
i have a problem.i've attaced two html file.  no-problem.html has no problem of course. but problem.html is problem with internet explorer 7. because there is a enter char after img element. it's no problem for chrome or ff.
what can i do?
thanks.


problem.html.txt
no-problem.html.txt
problem.jpg
0
Comment
Question by:erenpasa
  • 5
  • 3
9 Comments
 
LVL 39

Accepted Solution

by:
abel earned 500 total points
ID: 24373679
It is a classical problem. Whitespace after <img> tags, before the end of the enclosing block (<p> or <div> or <td> etc) will show this problem. You can only reliably solve it by removing this (officially insignificant) whitespace. And yes, I know, your pretty-printed layout of the code will be a bit disrupted. Long live IE.

Two resolutions:

<!-- version 1 -->
<div style="border:1px red solid">
    <div>
	<img class="style_0" src="http://sabri2.webtek.com.tr/UserFiles/1.jpg"/></div>
</div>
 
<!-- version 2 -->
<div style="border:1px red solid">
    <div>
	<img class="style_0" src="http://sabri2.webtek.com.tr/UserFiles/1.jpg"/><!--
    --></div>
</div>

Open in new window

0
 
LVL 39

Expert Comment

by:abel
ID: 24374146
Thought I was quite quick, thorough and complete, why do you B-grade me? Always give experts the chance to earn there A-grade, by following up in the question, we may be wizards, but we can't read minds. Please read EE's policy on 10pts must.
0
 

Author Comment

by:erenpasa
ID: 24374407
hi abel,
i've read the EE's policy now. you are right by EE's policy. if i read it before i give you A-grade. But i though that i 've attached a html file without problems  and you not said different things.I've give B-grade for this reason.

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 39

Expert Comment

by:abel
ID: 24374495
Ah, my apologies. I now see that I basically only told you what you already new. Why didn't you say so? I would've elaborated (which is why we're here, and sometimes it happens that we miss something of a question) if you'd asked.

And, back to the question: you actually new the problem. I seconded that. The solution is, as you now know, only a workaround (I can't make you happier about IE's quirks, I know). A more complex solution would be to use JavaScript to remove the whitespace. And I do remember a CSS-only solution, but I didn't get that working recently.
0
 
LVL 39

Assisted Solution

by:abel
abel earned 500 total points
ID: 24374593
I'm glad you came back and explained. I went back to the drawing board and tried some solutions. Use the following as a solution with CSS only, and you can keep your whitespace (and I will remember it, I hope, for the next time this question pops up):

If you feel you should change the grade based on this new info, you can click "Request Attention" next to your question and ask a moderator to reopen the question. They usually do that within about 12 hours.

<div style="border:1px red solid">
    <div>
    <img style="vertical-align:bottom;"
        class="style_0" src="http://sabri2.webtek.com.tr/UserFiles/1.jpg"/>
    </div>
</div>

Open in new window

0
 

Author Comment

by:erenpasa
ID: 24374666
hi abel,
i 've send a message to reopen the question. i'll change your graduate.

thanks alot.
0
 
LVL 39

Expert Comment

by:abel
ID: 24388748
tx, erenpasa and modus_operandi.
0
 

Author Comment

by:erenpasa
ID: 24388801
nop. bye.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

679 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