Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
100% DIV of absolute positioning & no page/html CSS
Old 02-07-2008, 03:19 PM 100% DIV of absolute positioning & no page/html CSS
Junior Talker

Posts: 3
Name: Tim
Trades: 0
Hello all. I am trying to create a script that will pop-up an image and darken the rest of the page. The darkened background is a separate DIV that overlays the entire page. I have it working in FF, but not in IE6/win. Here's my code:

Code:
<html>
<head>
<title>Test Page</title>
<link rel="stylesheet" type="text/css" media="all" href="popup/popup.css" />
</head>
<body>
     <div id='pop'></div>
</body>
</html>
Code:
#pop {
    position:absolute;
    height:100%;
    width:100%;
    top: 0px;
    left: 0px;
    background:#000;
    filter:alpha(opacity=36);
    -moz-opacity:0.36;
    opacity:0.36;
}
This should create a DIV that covers the whole page. Works in FF, as I stated above. But in IE it shows a wide but short rectangle at the top of the page. I can get around this by adding the following CSS:

Code:
html, * {
     margin:0 0 0 0;
}

body {
     height:100%;
}
But I don't want this. I don't want to alter the CSS for anything major since I plan to use the code on multiple sites that each have unique CSS, some with custom html and body CSS values.

Is there any way to keep the DIV positioned as absolute (I need that as well), not change the html or body CSS, and have it cover the whole page in IE6?

Any help is appreciated.
Thanks in advance,
-Tim
godspeed is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 02-07-2008, 03:48 PM Re: 100% DIV of absolute positioning & no page/html CSS
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Why not just use LightBox ?

http://home.comcast.net/~ahavriluk/lightboxEx/doc/
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-10-2008, 02:35 AM Re: 100% DIV of absolute positioning & no page/html CSS
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
It sounds like what you're trying to do is make a modal pop-up. I always hand-code these, although Lady's suggestion is still a good one. You might want to start by using fixed positioning on the semi-transparent div instead of absolute positioning.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 02-11-2008, 02:28 PM Re: 100% DIV of absolute positioning & no page/html CSS
Junior Talker

Posts: 3
Name: Tim
Trades: 0
I'm not using LightBox because I want to do it myself, and thus will be able to change it up easily (once it's finished).

The point of absolute positioning is that the partially transparent DIV is supposed to take up the entire screen / website so that it looks like it faded everything out behind it.

-Tim
godspeed is offline
Reply With Quote
View Public Profile
 
Old 02-11-2008, 02:36 PM Re: 100% DIV of absolute positioning & no page/html CSS
Junior Talker

Posts: 3
Name: Tim
Trades: 0
Ah ok, I see what you mean about setting it fixed.

But, when I set it fixed it works like a charm in Firefox. But in IE6/Win it places this overlay at the bottom of the page and does not move when the user scrolls.

Any ideas?

-Tim
godspeed is offline
Reply With Quote
View Public Profile
 
Old 02-11-2008, 02:41 PM Re: 100% DIV of absolute positioning & no page/html CSS
Webmaster Talker

Posts: 626
Trades: 0
I think that you problem is that IE does not accept height at 100%.

Set a fixed height. You could probably use some javascript to determine the resolution of the monitor and then set the height to the same value or something. Then, you could actually setup the javascript as a behavior so that only IE will run it.

Just a thought!
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 02-11-2008, 08:50 PM Re: 100% DIV of absolute positioning & no page/html CSS
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
No, IE accepts 100% height, but it does NOT recognize position: fixed.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 02-12-2008, 05:56 AM Re: 100% DIV of absolute positioning & no page/html CSS
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
LadynRed's suggestion is the best one god. There is nothing wrong with using snippets, and they are often made so that you can easily edit them. Why reinvent the wheel?

Personally, I prefer ThickBox which works on the jQuery framework.

To get a position: fixed in IE6 you need to use a hack.
Code:
* html #TB_overlay { /* ie6 hack */
     position: absolute;
     height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
The above was taken from the ThickBox CSS.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 02-13-2008, 12:28 AM Re: 100% DIV of absolute positioning & no page/html CSS
Webmaster Talker

Posts: 626
Trades: 0
So... Is it FF that doesn't accept 100% height?
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 02-13-2008, 04:05 AM Re: 100% DIV of absolute positioning & no page/html CSS
Super Moderator

Posts: 1,576
Location: Kokkola, Finland
Trades: 1
er, again: why not use lightbox or thickbox and customise it?

i mean someone's already sorted out how to do it so why not use what they've used, or at least look at how they've done it and that should answer your questions on how to do it.
davemies is offline
Reply With Quote
View Public Profile Visit davemies's homepage!
 
Old 02-13-2008, 10:59 AM Re: 100% DIV of absolute positioning & no page/html CSS
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
Both accept height 100%.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Old 02-13-2008, 01:10 PM Re: 100% DIV of absolute positioning & no page/html CSS
Webmaster Talker

Posts: 626
Trades: 0
Confused... Maybe I should be starting a new thread, but LadynRed. If you take a look at this thread: http://www.webmaster-talk.com/css-fo...n-firefox.html in one of the posts someone told me that height: 100% causes problems in IE.

Is this no longer the case??
jim.thornton is offline
Reply With Quote
View Public Profile
 
Old 02-13-2008, 02:07 PM Re: 100% DIV of absolute positioning & no page/html CSS
Mooofasa's Avatar
Defies a Status

Posts: 1,611
Name: Michael (mik) Land
Location: England
Trades: 0
The only post that says height 100% causes problems in IE is your own.
__________________

Please login or register to view this content. Registration is FREE
- Tumblog with thoughts, quotes, links, videos, images and my creations.

Please login or register to view this content. Registration is FREE
- The best free web browser.

Please login or register to view this content. Registration is FREE
- Firefox is now Firefail.
Mooofasa is offline
Reply With Quote
View Public Profile Visit Mooofasa's homepage!
 
Reply     « Reply to 100% DIV of absolute positioning & no page/html CSS
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44980 seconds with 12 queries