Sign in to follow this  
jbadams

Unity [web] IE rendering problem (extra whitespace)

Recommended Posts

I mentioned in this thread that I was having a similar spacing issue in IE to the problem described, but as the problem seems slightly different I thought I'd post another thread. The problem is a small amount of extra whitespace showing up beneath a div in Internet Explorer. At the moment I'm just working with a very basic testing layout to try to solve the problem. Firstly, some images to illustrate the problem. The first shows the page correctly rendered in Firefox, the second shows a correct render in Opera, and the third shows IEs bodgy render; note the whitespace under the 'image' along the top. Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us Free Image Hosting at www.ImageShack.us HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Page Title</title>

    <link rel="stylesheet" type="text/css" href="style.css" />

  </head>

  <body>
    <div id="banner_top"></div>
    <div id="banner_l1"></div>
  </body>
</html>
CSS:
body	{
	margin: 0px;
	padding: 0px;
	background-color: #000000;
	}
#banner_top {
	background: #ffffff url('banner_top.jpg') repeat-x;
	height: 10px;
	}
#banner_l1 {
	background-color: #00ff00;
	width: 10px;
	height: 10px;
	}
"banner_top.jpg" is a 20x10 jpeg image I'm using for testing purposes. The second div currently only exists to illustrate the issue clearly, but I will need another div sitting flush with the first in that fashion. So anyone got any ideas what could be causing the extra space to be rendered?

Share this post


Link to post
Share on other sites
Although I've encountered DIV problems before, this certainly wasn't one of them. However, specifying the overflow property for the second DIV and setting it to hidden has resolved the problem here for me. However, I've not got FireFox or Opera installed on this box, so I can't see if it has another effect elsewhere.

The CSS resulted in the following:

body	{
margin: 0px;
padding: 0px;
background-color: #000000;
}
#banner_top {
background: #ffffff url('banner_top.jpg') repeat-x;
height: 10px;
}
#banner_l1 {
background-color: #00ff00;
width: 10px;
height: 10px;
overflow: hidden;
}




Does that solve the problem for you?

Share this post


Link to post
Share on other sites
Quote:

overflow
Possible Values:
visible
hidden
auto

When something has a width or height defined that is shorter than the element, this decides whether to hide the remaining part of the element, or show it. By default it is set to visible. But you can hide the overflow if you wish:


Why the height of that element is as large as it is in IE is beyond me. It definitely makes it look correct here, though.

Share this post


Link to post
Share on other sites
It does indeed, although I had to apply it to both divs - it seems that applying it only to the one experiencing the original problem 'stretched' the second. [rolleyes]

Firefox remained uneffected, and IIRC Opera ignores the overflow property; in any case, it also still renders correctly.

Thank you very much for the solution in any case, hopefully that won't cause any additional unwanted cascade effects.

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  

  • Partner Spotlight

  • Forum Statistics

    • Total Topics
      627674
    • Total Posts
      2978558
  • Similar Content

    • By trjh2k2
      I've never really been a "Unity guy", since all of my game-dev learning happened in C++, and in other engines, but I recently discovered the "complete projects" section in the asset store.  It's full up on projects you can buy that are billed as "ready to customize and release", with full ad integration.  Some of them claim to be for educational purposes, but why would you include a complete, polished, full featured game with ads as an educational example?
      This leads me to the question of why this goes by unchallenged?  Does Unity and the environment of the Unity Store actively encourage this style of game development?  Is the problem of asset flipping our own fault?  I don't mean this as a "we should make Unity shut this down" kind of thread, but rather just to examine whether or not the environment of being able to just buy whole games or pieces of games is something that damages the industry.  I get why Unity would allow it, and I'm sure it's a working business model for some people- and maybe some people DO actually just use these to learn from, but I'm not that naive as to think that there aren't people who recognize this as one of the shortest paths to putting a game on the market so they can cash in.
      Thoughts?
    • By StefanJo
      Hi everyone!
      I have just released a project called Line Driving to the Unity Asset Store.
      Line Driving is complete project ready for release for both Mobile and PC. 
      It is a game where you have to draw your own road for a car using mouse controls or touch input.
      Features:
      1.Simple to understand,detailed commented scripts 
      2.Well-written documentation 
      3.Mobile-ready 
      4.Unity Ads implemented 
      5.Easy to customize 
      and much more… 
      Link to the asset: https://www.assetstore.unity3d.com/#!/content/101595
      Support email: sjovanovic0831@gmail.com



    • By Kurupted Playz
      Hey, I'm looking for some people that can help me with a game that I'm making that is a 3d platformer.
      I mostly need someone for character design and animation,  I can do some coding but if you can do coding as well you're still welcome because I'm still not the greatest at coding just yet.
      if you need to contact me add me on discord @ Kurupted#1206
       
    • By Jcyshadow97
      Hi,guys.I m working on a Fantasy RPG.Currently i m work alone on the project.I really need someone can make UI stuff.If someone can handle it please feel free to contact me on email: 270514974@libero.it.
      Thank you guys and sorry for my english.
       
       



    • By STRATUM the Game
      Hey, everyone! This is my first post here.
      I would like to know what you think about my project called STRATUM. It's a 2D platformer that is heavily based on storytelling and boss fighting while trekking through the world.

      Everything in STRATUM takes place in the first century AD, in a world that wraps our own universe, called  The Stratum. A parallel Universe that is the home of the Christian deities . In this game you will play as a Dacian warrior, unfamiliar with everything in this world, you’ll get to know and understand The Stratum together with him.
      The main thing that I want with STRATUM is to reinvent the known lore and history of the Christian deities and realms. 
      The story is unconventional, it plays down a lot of the mysticism of Hell or Heaven and it gives it a more rational view while keeping the fantastic in it. What do I mean by that? Well, think about Hell. What do you know about it? It's a bad place where bad people go, right? Well, that's not the case in STRATUM. I don't want to describe such a world. In STRATUM, there is a reason for everything, especially for the way Hell is what it is in the game. "Hell" is called The Black Stratum in the game.
      This world is not very different from Earth, but it is governed by different natural laws.
      The story will also involve the reason why this world entered in touch with ours.

       
      What do you think about all that I said? Would you be interested in such a game? I have to say that everything is just a work of fiction made with my imagination. I do not want to offend anyone's beliefs.
      I want this to be a one man game. I have been working alone on it (this was my decision from the beginning) from art to effects to programming to music to sound effects to everything.
      I also have a youtube video HERE if you want to see the way the game moves and the way my music sounds.
      Please, any kind of feedback will be highly appreciated. If you have something bad to say, do it, don't keep it for yourself only. I want to hear anything that you don't like about my project.
       
  • Popular Now