How to align a layer in the center of a page using dreamweaver ? Such as this yahoo page right here.How to align a layer in center ?
%26lt;style type=';text/css';%26gt;
.centerMe {
margin-left: auto;
margin-right: auto;
}
%26lt;/style%26gt;
%26lt;div class=';centerMe';%26gt; Centered text%26lt;/div%26gt;How to align a layer in center ?
center a layer, not a div tag Report Abuse
There are many good books available at the average public library on Dreamweaver. They would do a better job of answering questions like that than I ever could. My favorites are The Complete Idiot's Guides and The Dummies Guides although your local library may not have those for Dreamweaver.
Best option is to label a DIV with a unique ID or a class and apply the styling via CSS. Conventional wisdom suggests that you then just need to give the div a width and then set the margins to auto. I however allways take the extra step of setting the text alignment on the document body to center - otherwise the centered div generally doesn't work in older versions of IE.
sample code below.
%26lt;!DOCTYPE html PUBLIC ';-//W3C//DTD XHTML 1.0 Transitional//EN';
';http://www.w3.org/TR/xhtml1/DTD/xhtml鈥?br>
%26lt;html xmlns=';http://www.w3.org/1999/xhtml';%26gt;
%26lt;head%26gt;
%26lt;title%26gt;%26lt;/title%26gt;
%26lt;meta http-equiv=';content-type'; content=';application/xhtml+xml; charset=utf-8'; /%26gt;
%26lt;style type=';text/css';%26gt;
body{
text-align: center;
}
#Container{
width: 800px;
margin: 20px auto 40px auto;
/*
margin shorthand notation used to apply 20px margin
to the top and 40px bottom of the box, and auto to the
left and right
notation: top right bottom left
*/
}
%26lt;/style%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;
%26lt;div id=';Container';%26gt;
%26lt;!--//
Regular content goes here
//--%26gt;
%26lt;/div%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment