Jump to content
xisto Community
Sign in to follow this  
twitch

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

Recommended Posts

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;

Share this post


Link to post
Share on other sites

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. :D [N]F

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.