-2

I'm a beginner so I don't understand much about HTML and CSS.

My problem is:

I created a DIV and i want that div expands to all page with 100% width and 100% height but currently i can't do that.

Someone can help me?

(Sorry for bad english)

Regards.

1 Answers1

0

for jquery:

$('div').css('position', 'fixed');
$('div').css('width', $('body').css('width'));
$('div').css('height', $('body').css('height'));

js:

document.getElementById('divId').style["position"] = 'fixed';
document.getElementById('divId').style["width"] = document.body.offsetWidth;
document.getElementById('divId').style["height"] = document.body.offsetHeight;

css:

#yourDivId {width:1000px; height:1000px; position: fixed;}
Jojodmo
  • 23,357
  • 13
  • 65
  • 107
Lo Ka
  • 107
  • 1
  • 3