Friday, January 8, 2010

HTML Coding question?

I can't center this div with the height, i can't figure out what i'm doing wrong








%26lt;div style=';width: 653px'; align=';center';%26gt;...%26lt;/div%26gt;HTML Coding question?
Almost had it correct:





%26lt;div style=';width: 653px; margin: 0 auto;';%26gt;...%26lt;/div%26gt;





That will center the div container inside whatever container it is in. If you want it a certain height, then add:





height: YYpx;





Vertical centering takes a little more effort.





RonHTML Coding question?
You're welcome.





Ron Report Abuse

Aligning it to the center:





vertically:


%26lt;div style=';margin-top: auto; margin-bottom: auto';%26gt; ....





horizontally:


%26lt;div style=';margin-left: auto; margin-right: auto';%26gt;...
%26lt;div align=';center'; style=';width: 653px; height:100px;'; %26gt;.. Somthing ..%26lt;/div%26gt;
Sigh, my mate would know this problem straight away. I think it's because you haven't got a ';center'; before style or width. But don't quote me on it. I'm quite useless at HTML.
First you type this on the note pad,then copy it and paste it on the front page.Thus you will get.

No comments:

Post a Comment