User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the HTML and CSS section within the Web Development category of DaniWeb, a massive community of 455,976 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,797 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our HTML and CSS advertiser: Lunarpages Web Hosting
Views: 2008 | Replies: 5
Reply
Join Date: Jun 2006
Posts: 27
Reputation: jetru is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
jetru jetru is offline Offline
Light Poster

empty space divs in IE

  #1  
Nov 27th, 2007
I have empty space div that goes like this:
<div id="space"><!-- IE fix--></div>

and the CSS for this is:
#space{font-size:0;
   background-color:transparent;
   height:15px;
   display:block;
}

This should just make an empty box. And its fine in firefox. But in IE I get no space at all! Whats wrong?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2007
Posts: 2,604
Reputation: MidiMagic is on a distinguished road 
Rep Power: 7
Solved Threads: 119
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Posting Maven

Re: empty space divs in IE

  #2  
Nov 27th, 2007
IE does not render "wasted" tags (tags without actual content).

Stick a br tag inside it.
Daylight-saving time uses more gasoline
Reply With Quote  
Join Date: Jul 2007
Posts: 48
Reputation: CertGuard is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
CertGuard's Avatar
CertGuard CertGuard is offline Offline
Light Poster

Re: empty space divs in IE

  #3  
Nov 28th, 2007
Or &nbsp;
--
Robert Williams
CEO, Founder
CertGuard
Reply With Quote  
Join Date: Jun 2004
Posts: 231
Reputation: cmills83 is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 0
cmills83 cmills83 is offline Offline
Posting Whiz in Training

Re: empty space divs in IE

  #4  
Dec 3rd, 2007
Theres no reason to have an empty space div, just add a margin to the surrounding div
Reply With Quote  
Join Date: Jun 2004
Location: Hemet, CA
Posts: 429
Reputation: FC Jamison is on a distinguished road 
Rep Power: 5
Solved Threads: 18
Colleague
FC Jamison's Avatar
FC Jamison FC Jamison is offline Offline
Posting Pro in Training

Re: empty space divs in IE

  #5  
Dec 6th, 2007
I am leaning toward cmills on this one. Why do you need an empty div?

If it is a must, you could also try throwing a transparent "spacer" gif in there.
Reply With Quote  
Join Date: Jul 2007
Posts: 48
Reputation: CertGuard is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
CertGuard's Avatar
CertGuard CertGuard is offline Offline
Light Poster

Re: empty space divs in IE

  #6  
Dec 6th, 2007
I was going to agree with you, then I found this DIV tag in my own code which I forgot I used to adjust the position of the content below it. (It seemed to be the simplest solution at the time)

<div style="height: 37px;">&nbsp;</div>

Like I had mentioned before, &nbsp; works just fine.
--
Robert Williams
CEO, Founder
CertGuard
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb HTML and CSS Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the HTML and CSS Forum

All times are GMT -4. The time now is 9:21 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC