i was able to find a good script on centering a div vertically but not compatible on ie old browser and another issue my div is pushing up because i have a footer and i dont know how to adjust on script adding a top border :(

<script type="text/javascript">
		<!--
		function getWindowHeight() {
			var windowHeight = 0;
			if (typeof(window.innerHeight) == 'number') {
				windowHeight = window.innerHeight;
			}
			else {
				if (document.documentElement && document.documentElement.clientHeight) {
					windowHeight = document.documentElement.clientHeight;
				}
				else {
					if (document.body && document.body.clientHeight) {
						windowHeight = document.body.clientHeight;
					}
				}
			}
			return windowHeight;
		}
		function setContent() {
			if (document.getElementById) {
				var windowHeight = getWindowHeight();
				if (windowHeight > 0) {
					var contentElement = document.getElementById('content');
					var contentHeight = contentElement.offsetHeight;
					if (windowHeight - contentHeight > 0) {
						contentElement.style.position = 'relative';
						contentElement.style.top = ((windowHeight / 2) - (contentHeight / 2)) + 'px';
					}
					else {
						contentElement.style.position = 'static';
					}
				}
			}
		}
		window.onload = function() {
			setContent();
		}
		window.onresize = function() {
			setContent();
		}
		//-->
		</script>

i found a better script which are compatible with old ie
is it possible to adjust alignment to be a little not and not too center because of the footer

<script type="text/javascript">

$(function() {
  $.fn.verticalCenter = function() {
    $(this).each(function() {
      $pageCenter = $(this).height() / 2;
      $windowCenter = $(window).height() / 2;
      $top = $windowCenter - $pageCenter;
      $(this).css({
        'position': 'relative',
        'top' : $top + 'px'
      });
    });
  }
  myResize = function() {
	  
	  
	    
	  
   $('#content:visible').verticalCenter();
  }
  $(window).resize(myResize);
  myResize();
});


</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.