Nov 8, 2009

IE And It's Annoying NBSP (Non-Breakable Space) - How to stop it

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Designing > Web Design and HTML

IE And It's Annoying NBSP (Non-Breakable Space) - How to stop it

twitch
Fellow designers, developers and table makers. This is a short explanation and tutorial on problem-child Internet Explorer's urge to fill empty div or table tags with a non-breakable space (html char code   ).

Why does IE put NBSP into empty div/table tags?
Here comes a really professional answer. I don't know why. Surely it takes that bit longer to put a conditional statement that if there is an empty tag, fill it with somet. Surely, it would be easier to say don't fill. But then again, MS never do things by half.

The Work Around
There may be a Javascript or even more simpler way than doing it this way, but so far I have not come across it. The only way to stop IE from rendering the div or table to the height of the text in which it contains (if it is empty, MS puts in a non-breakable space, therefore renders at the size of the body text) is to create a 1px*1px GIF with an index transparency of white and the background of white. This makes it a clear square. It is still classed as an object, so by putting <img src="images/clear.gif" alt="" height="1px" width="1px" /> it renders whatever div/table cell at whatever height you specify (below the body text size).

If you don't want that div or table/cell to be rendered, then it is even easier, use CSS and set whatever element it is to display: none;

 

 

 


Comment/Reply (w/o sign-up)

nightfox
Hmm...
normally I just use a transparent gif anyways and just fill the cell (usually keeping the gif's height 1 px). I find that this way, the design keeps its proper shape in ALL or MOST browsers. Normally, browsers won't go crazy if it can't move the object. But I ALWAYS suggest filling empty space with a transparent gif. They work perfectly as a "brace" to keep it all together. wink.gif

[N]F

Comment/Reply (w/o sign-up)

FeedBacker
How can I stop IE from inserting this- ( ) -into an email that I\\
IE And It\'s Annoying NBSP (Non-Breakable Space)

Replying to twitch

Does anyone know why this is happening and how I can stop it.

How can I stop IE from inserting this- ( ) -into an email that I'm typing in yahoo

Any info would really help

Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : It39s Annoying Nbsp


    Looking for annoying, nbsp, breakable, space, stop

See Also,

*SIMILAR VIDEOS*
Searching Video's for annoying, nbsp, breakable, space, stop
advertisement



IE And It's Annoying NBSP (Non-Breakable Space) - How to stop it

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com