Sunday, February 24, 2008

Driving In France For Indian Tourists

CSS - D & R Design

APPLICATION

How is centered horizontally the main container of a page?

RESPONSE

If we assume that the principal has div id = "container" CSS rules essential to have it off 760 pixels and centered are:

body {text-align: center} / * centers in IE5.x * /
div # container {width: 760px;
margin: 0 auto; / * centers in other browsers * /
text-align: left; / * restore alignment * /}

The focus for modern browsers can be obtained only with the Declaration on the edge of the container: the value of cars on either side margins means that they the same distance from the browser window. Internet Explorer 5.x does not interpret the statement and erroneously requires the declaration of text-align the body, is restored to left in the second rule.

0 comments:

Post a Comment