Solved

Internet explorer crlf, white space problem

Posted on 2009-05-13
9
368 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
[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
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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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 …

615 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