Sunday, August 2, 2009

Web Design - what's the easiest way to make your content centre itself in a browser window?

I know how to do this using frames - but it always gives me ugly scroll bars in the centre area! There must be a simple way. I use Dreamweaver. Tables maybe? Any help would be appreciated!

Web Design - what's the easiest way to make your content centre itself in a browser window?
You really should avoid using tables and get used to DIVs. Google much prefers them. I used tables and was a huge supporter, until CSS standards began to work in both Mozilla and IE. Now I only use tables for things that are actually tables of data. With the new sortable column features that CSS offers, DIVs are often even better for that.





This makes an 800px wide box, and centers everything inside it. Remove the "width:800px" and the DIV will stretch to fill the entire width of the window.





%26lt;div style="text-align:center;width:800px"%26gt;


My content My content My content My content My content My content My content My content.


%26lt;/div%26gt;
Reply:%26lt;center%26gt;content here%26lt;/center%26gt;
Reply:You can use the center tags


%26lt;center%26gt; %26lt;/center%26gt;





or based on what html editor you are using you can use their center buttons to center it.





But sometimes the above may not work and if it dosen't you may have to take a look at your code and see if you have some extra spacing codes   or extra div tags %26lt;div%26gt; or span tags %26lt;span%26gt; or other format tags that may be messing you the alignment,
Reply:Have you tried using layers with dream weaver
Reply:Tables are what you need:





%26lt;table align="center"%26gt;


%26lt;/table%26gt;
Reply:In the html put





%26lt;center%26gt;Around whatever you want%26lt;/center%26gt;
Reply:Not having a look at the code for this page I assume it's made with tables and table columns. Placing a %26lt; center%26gt; tag before the table will center it on the page for you. Then it's a process of using nested tables (tables within tables).


No comments:

Post a Comment