Contact Us
Web Development Team

resources

helpful hints - CSS



Helpful Hints JavaScript is a scripting language most often used for client-side web development. The primary use of JavaScript is to write functions that are embedded in HTML pages and interact with the Document Object Model (DOM) of the page. Some simple examples of this usage are:

Because JavaScript code can run locally in a user's browser (client side as opposed to server side), it can respond to user actions quickly, making an application feel more responsive. Furthermore, JavaScript code can detect user actions which HTML alone cannot, such as an 'onClick' or 'onmouseover' event.



Positioning Div within Monitor Centered Div

If we set relative positioning on div Container, any elements within the container will be positioned relative to div Container. Then if we set absolute positioning on div Something, we can move it to the desired location of div Container using properties 'top' and 'left'.

#container {
   position:relative;
   margin: 0 auto; /* align for good browsers */
   text-align: left; /* counter the body center */
   width: 780px;
   height: 320px;
}
#something {
   position:absolute;
   width: 240px;
   top: 140px;
   left: 100px;
}
Copyright © 2008 by DSD Web Works - All rights reserved.
Site Map