Sunday, August 2, 2009

How to dynamically position html element depending on screen specs?

What would the javascript code be like?

How to dynamically position html element depending on screen specs?
JavaScript!? No No No!





Use a CSS file to tell it that is should have a margin-left (or right, or top, or bottom, what ever takes your fancy) of x%





So, if I have a %26lt;div id='holder'%26gt; and I want it to be 40% wide, and centered easily:





div#holder {


width:40%;


margin-left:30%;


}


No comments:

Post a Comment