%26lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"%26gt;
%26lt;html%26gt;
%26lt;!-- Created with the CoffeeCup HTML Editor 2007 --%26gt;
%26lt;!-- http://www.coffeecup.com/ --%26gt;
%26lt;!-- Brewed on 0/00/0000 00:00:00 _ _ --%26gt;
%26lt;head%26gt;
%26lt;title%26gt;%26lt;/title%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;
%26lt;div%26gt;%26lt;img style="Z-INDEX: 100; LEFT: 0px; POSITION: absolute; TOP: 20px" height="671" alt="" src="file://C:\Users\Peter Krawczyk\Desktop\blue_back.jpeg" width="766" border="0"%26gt;%26lt;img style="Z-INDEX: 100; LEFT: 0px; POSITION: absolute; TOP: 0px" height="20" alt="" src="file://C:\Users\Peter Krawczyk\Desktop\top_black.jpg" width="766" border="0"%26gt;%26lt;/div%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;
How do you change the following html code in order to make the page center, like the yahoo homepage.?
easy dude...
just use a little bit of CSS between the head tags like this
%26lt;head%26gt;
%26lt;title%26gt;%26lt;/title%26gt;
%26lt;style type="text/css%26gt;
body{
text-align: center;
}
.container{
margin-left: auto;
margin-right: auto;
}
%26lt;/style%26gt;
%26lt;/head%26gt;
and then add class="container" to the div tag like this....
%26lt;div class="container"%26gt;
all this because the Center tag is forbidden by the W3C and is not an standard any more.
hope it helps ;)
Reply:%26lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"%26gt;
%26lt;html%26gt;
%26lt;!-- Created with the CoffeeCup HTML Editor 2007 --%26gt;
%26lt;!-- http://www.coffeecup.com/ --%26gt;
%26lt;!-- Brewed on 0/00/0000 00:00:00 _ _ --%26gt;
%26lt;head%26gt;
%26lt;title%26gt;%26lt;/title%26gt;
%26lt;/head%26gt;
%26lt;body%26gt;%26lt;center%26gt;
%26lt;div%26gt;%26lt;img style="Z-INDEX: 100; CENTER: 0px; POSITION: absolute; TOP: 20px" height="671" alt="" src="file://C:\Users\Peter Krawczyk\Desktop\blue_back.jpe... width="766" border="0"%26gt;%26lt;img style="Z-INDEX: 100; CENTER: 0px; POSITION: absolute; TOP: 0px" height="20" alt="" src="file://C:\Users\Peter Krawczyk\Desktop\top_black.jpg... width="766" border="0"%26gt;%26lt;/div%26gt;%26lt;/center%26gt;
%26lt;/body%26gt;
%26lt;/html%26gt;
Reply:The CENTER is a general centering tag and can be used with any type of element on your page (paragraphs, headings, images, forms, tables, etc.) even if there is another method for centering.
To center any element on your page, simply put the start %26lt;CENTER%26gt; tag at the beginning of the section you want to center, and the end %26lt;/CENTER%26gt; tag at the end of it. Everything between these tags will be centered.
The CENTER tag automatically starts a new line underneath it. You do not have to use the %26lt;P%26gt; or %26lt;BR%26gt; tags to start a new line.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment