Connecting Tech Pros Worldwide Forums | Help | Site Map

Full screen div

Newbie
 
Join Date: Oct 2008
Posts: 8
#1: Oct 7 '08
hi everybody, this is my first time posting something. And I'm sorry because my english is far from perfect.

I'm trying to make a fullscreen transparent div but I have some restrictions on the way to do it. My div should be inside another div. As the containig div isn't full screen I think the inside div can't be full screen. . . .

I try to achive this in several steps to reduce complexity. The first step was to make a transparent 100% width, 100% height div inside anotherone, this should be portable to IE6+ and Firefox. In firefox it works fine, but in IE6 is a mess, the contained div height is much less than 100% of the container div.

Can anybody help me to make this work on IE6?

Can anybody tell me if is posible to make the transparent div fullscreen inside the other div?

Here is the code:

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  
  3. </html>
  4. <body>
  5. <form>
  6.     <input type="text" size="20"/>
  7.     <input type="buttom" value="Enviar"/>
  8. </form>
  9.  
  10. <div style="position:relative; top: 0; left:0; background-color:#0000ff; border:1;">
  11.  
  12. <div style="position:absolute; top:0;left:0; height:100%; width:100%; background-color:#aaaaaa; filter: alpha(opacity=80, finishopacity=10; style=0);z-index:999;opacity:0.8">
  13.  
  14. </div>
  15.     <div style="position:relative; background-color:#ffffff; opacity:1; margin: 0 auto 0 auto; width:220; height:200; text-align:center; z-index:1000">
  16.         First trial
  17.     </div>
  18.  
  19.  
  20. </div>
  21.  
  22. </body>

Markus's Avatar
Moderator
 
Join Date: Jun 2007
Location: York, England, with wolves.
Posts: 4,949
#2: Oct 7 '08

re: Full screen div


Hey there, hdsk.

When posting code on the forums, be sure to use [code] tags. [code] .. code goes here [/code]. If you neglect to do so, you will be given a warning and possibly a temporary ban. Please read the Posting Guidelines on How To Ask A Question

Markus.
Newbie
 
Join Date: Oct 2008
Posts: 8
#3: Oct 7 '08

re: Full screen div


Quote:

Originally Posted by Markus

Hey there, hdsk.

When posting code on the forums, be sure to use [code] tags. [code] .. code goes here [/code]. If you neglect to do so, you will be given a warning and possibly a temporary ban. Please read the Posting Guidelines on How To Ask A Question

Markus.

Thanks for the advice Markus, I didn't know that.
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,580
#4: Oct 7 '08

re: Full screen div


You will never get IE to attempt to perform like modern browsers without a proper doctype. See the article about doctypes under the Howto section at the top.
Newbie
 
Join Date: Oct 2008
Posts: 8
#5: Oct 7 '08

re: Full screen div


Quote:

Originally Posted by drhowarddrfine

You will never get IE to attempt to perform like modern browsers without a proper doctype. See the article about doctypes under the Howto section at the top.

Hi,

Thanks for your answer.

I try all the doctypes in the howto section and none of them work for me. Using them changes how the div looks. Their width and height seem to change but they doesn't make the right efect. In firefox with those doctypes I can't see the gray background. It seem all div be the same width/height and the top one hidding the others.

In IE almost same problem as before :-(.
Expert
 
Join Date: Aug 2008
Posts: 397
#6: Oct 7 '08

re: Full screen div


Quote:

Originally Posted by hdsk

Hi,

Thanks for your answer.

I try all the doctypes in the howto section and none of them work for me. Using them changes how the div looks. Their width and height seem to change but they doesn't make the right efect. In firefox with those doctypes I can't see the gray background. It seem all div be the same width/height and the top one hidding the others.

In IE almost same problem as before :-(.

Sorry. Don't think your construct will work. Even if the CSS was valid. Even without a doctype. Even with a doctype. Even with doctype and valid HTML and valid CSS.
drhowarddrfine's Avatar
Expert
 
Join Date: Sep 2006
Posts: 5,580
#7: Oct 7 '08

re: Full screen div


Quote:

Originally Posted by hdsk

I try all the doctypes in the howto section and none of them work for me. Using them changes how the div looks. Their width and height seem to change but they doesn't make the right efect.

Of course it does. The doctype is the set of rules you are telling the browser you are using. Change the doctype, change the rules. But you have to get all the browsers on the same set of rules and IE is the one that's in outer space.

Use the html 4.01 strict doctype, validate your html and css, fix the errors there, then see where we are.
Reply


Similar HTML / CSS bytes