Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
| Search | Today's Posts | Mark Forums Read
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 31st, 2007, 07:22 PM
tal tal is offline
Authorized User
 
Join Date: Apr 2007
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Percentage: IE6 vs. All others?

Hi guys,
I'm using an html DIV with width and height specified by percentage (e.g. "width:90%"). When I checked it on IE6, I suddenly noticed it's not working! IE6 can't figure out percentages, no matter what I do.

I urgently need a workaround for this, and I can't find it anywhere... (could be in javascript, i don't mind... just anything that will work on both ie6 and ie7...)

Any ideas
Thanks!

 
Old August 1st, 2007, 11:29 AM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

Hi tal!

Funny, I've just been working on an accessible form layout for an ASP.NET contact form. There I'm able to set the width beautifully in IE but not FF.

Is your page posted online? I'd like to see it in action. Your technique is valid, so I'm not sure just from a problem description what's going wrong.

If your page isn't live, do a couple things for me. Post your HTML in a reply and if you're using external CSS, post the stylesheet too.

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.
 
Old August 1st, 2007, 01:56 PM
tal tal is offline
Authorized User
 
Join Date: Apr 2007
Location: , , .
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi master,
what I'm doing is very simple:
<div id=main_div style="overflow: hidden; left: 5%; top: 200; width:90%; height:75%;position: absolute;">

Where all these parameters are a must.
On FF/IE7 this works fine, the div is exactly the size i specify. On IE6 i see a horizontal line...
Could you put your html for comparison?

(my page is not online..)

tal.

 
Old August 1st, 2007, 05:57 PM
Friend of Wrox
Points: 1,749, Level: 16
Points: 1,749, Level: 16 Points: 1,749, Level: 16 Points: 1,749, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2007
Location: San Diego, CA, USA.
Posts: 477
Thanks: 10
Thanked 19 Times in 18 Posts
Default

I can't find anything wrong, but then that's why it works fine in FF and IE7. I think it might be that IE6 is ignoring the height and collapsing. If that's true, then the horizontal line should be consistent in color and length with the border on the div? I would think that the content of the div would force it open though. I hate these problems!

I don't have my contact form experiments up yet, but that's not a bad thing. I don't think it would help you much. I DO have a navbar that I control with CSS and Javascript, and that DOES work. The navbar uses absolute positioning and it might help you.

The XHTML is at http://beta.earthchronicle.com

The markup for the two navbars is at the end of the file.

The CSS is at http://beta.earthchronicle.com/ECBeta/EC.css

I've titled the CSS relevant to the navbar's structure and it's the second section of the stylesheet. If you need to see the border information, all my visuals (colors and borders) are in the Sepia.css file in the same directory.

Take another stab at it, and let me know if that's useless to you and/or you're still having trouble with it.

-------------------------

Whatever you can do or dream you can, begin it. Boldness has genius, power and magic in it. Begin it now.
-Johann von Goethe

When Two Hearts Race... Both Win.
-Dove Chocolate Wrapper

Chroniclemaster1, Founder of www.EarthChronicle.com
A Growing History of our Planet, by our Planet, for our Planet.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate Percentage with Date mateenmohd Access 2 February 4th, 2008 06:26 AM
percentage height GuyB CSS Cascading Style Sheets 1 July 6th, 2006 09:42 PM
percentage formula.....? pls help mnr555 Crystal Reports 0 June 19th, 2006 12:11 PM
Calculate a difference percentage skwilliams Classic ASP Basics 15 April 4th, 2006 06:46 AM
percentage darkhalf Javascript 2 October 28th, 2005 02:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.