Forum Moderators: open

Message Too Old, No Replies

Centered Page Design

best way to do it and what are the cons...?

         

Harley_m

4:51 pm on Sep 9, 2002 (gmt 0)

10+ Year Member



Hi,

Thinking of designing a site as a central column with blank either side as seen on many sites, with blank to either side, which is the best method to use to do this (smallest/neatest/fastest ect) and are there any ramifications to using this design? Does it have to be done using a frame (i use DW mainly) in which case we get back to the old frames are awful thing...

Any help at all would be most welcome...

Thanks all for such a great forum

Harley

Nick_W

5:03 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




[pre]
body {
margin-left: 10%;
margin-right: 10%;
}
[/pre]

Or add padding to a div containing the body of your page.

But why?
Why do you want to limit the page size, seems kind of odd to me?

Nick

Harley_m

5:30 pm on Sep 9, 2002 (gmt 0)

10+ Year Member



The design of the site would look much better centralised, and while i dont want one tiny little column in the middle, it would be much better centralised, and needs to be limited to allow viewing under high res's possible without changing the layout...

is it possible to simply centralise the page, and have it a set width
and if it is, what should that be..? 1024?

Thanks

harley

Nick_W

5:41 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You shouldn't do that at all.

Go with the flow, allow your page to fill the browser, those with high rez monitors generally resize their browser windows to a comfortable level.

Fixed width design... Yeush, this ain't print media, the web is a fluid, adaptable medium.

If you stop trying to control every aspect of the suer experience and worry more about making sensible suggestions to the browsers and devices that access your pages you'll be happier, your users will be happier and your code will be much more efficient.

xhtml/css layout... A little investment of time and you'll never look back...

Nick

martinibuster

6:01 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Ladies and gentlemen, please hold your tomatoes.

You can always do a table (align="center"). Make sure that the table width is set to nothing wider than 750 px.

Or alternatively, you can set the width to 100% and let it resize to fit the browser.

Okay, you can now let your tomatoes fly. :o

Nick_W

6:08 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



SPLAT!

Traitor.... ;-)

Nick

txbakers

6:51 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I guess I'm a traitor too. I use table width="780" align="center"
Those with smaller resolution have to scroll a little, those with the most popular resolution don't, those with big resolution have some side space.

It works, it looks nice in all browsers, it's easy to maintain.

What's the crisis?

Nick_W

6:58 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No crisis, just that those of us that really do the CSS thing start to foam at the mouth when we hear thing like "fixed width page" and "table based layout"

Each to their own, as long as you know there's a better alternative it's up to the individual to decide whether to use it or not...

(Bad wilson! you wern't going to write that last bit were you? Go stand in the corner!)

Nick

Harley_m

7:02 pm on Sep 9, 2002 (gmt 0)

10+ Year Member



no guys your right, i dont want to be telling the user how to view the page, but at the same time, i want to be sure that the page proportions display pleasingly with that user. The centre aligned table does appear to be the best solution in this case...

i agree with your comments Nick_w, but not all web pages should look the same, be boring with tiny super fast loading images, tons and tons of text and hyper links per page, and crammed full of optimisation. if they were all like this then the web would be a boring place. im sure many car makers have gone "yeesh" to many ideas, but if all cars were the same, that wouldnt work either.

Be it using CSS any form of HTML or any other format, it is my prfessional design opinion that the design will look better centralised, and so that is what i shall do...

txbakers

7:15 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



WAY TO GO HARLEY! WOO WOO! Score one for the Table Team!

Gimme a "T"! Gimme a "A"!

(etc)

too much caffeine this afternoon I guess.

Nick_W

7:31 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hehe, nutter!

Here's something I did <table>less that demonstrates my original <body> tag and margins post...


[pre]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
<?xml version="1.0" encoding="iso-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<style type="text/css">
body {
margin: 0;
padding: 1em 20% 1em 20%;
background-color: #FFFFFF;
color: #000000;
}

p, ul, li, dt, dd, h4 {
font: 1em verdana, arial, helvetica, sans-serif;
}

h1 {
font: 1.7em bold arial, helvetica, sans-serif;
padding: .2em;
border: 1px solid #000000;
}

h4 {
font-weight: bold;
}
</style>
<title>Example of centered column</title>
</head>
<body>
<h1>Example of centered column</h1>

<p>You can stick anything in here, even <em>Gasp!</em> tables!
This is something I had already that demonstrates what you want to
do, to a certain extent. You'll need to mess with it of course ;-)
</p>
<p>By using percentages as opposed to fixed fixed width you allow
your users to see a page that flows with their browser window.</p>
<ul>
<li>Really high rez types resize their browsers</li>
<li>Really low rez types still see a nicely proportioned
page</li>

<li>Most users see the page at a very comfortable level</li>
</ul>
<h4>Adjustments</h4>
<p>Just mess with the percentages in the body rule, there's no
reliable way to center a fixed width div with CSS without resorting
to nested divs as demonstrated in an earlier discussion by
<strong>Mivox</strong>.</p>
<p>Have fun!</p>
</body>
</html>
[/pre]

Nick

mivox

7:47 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



But nested divs work... hehe.

(However, the "margin: auto" technique that makes nested divs work with a fixed-width center layout wasn't my idea... My nested div layout was to create a centered, fluid-width layout that worked in NN4. ;) I almost never used fixed-width layouts anymore!)

Harley_m

8:10 pm on Sep 9, 2002 (gmt 0)

10+ Year Member



Nick_w - good example, and i see exactly where your coming from on that. Playing around with that gives precisely what i wanted, but i cant see how this does anything better than you could do with tables (woohoo!) is this exact code written in CSS actually faster to load/more compatible ect than it would be in strait HTML?

anyway, some good thoughts, and thank you very much for all your comments.

One last thing, how would i best get it so at say 800/600 it would display say 90% or 100% width, but once the window is resized and enlarged it then proportionatly scales like it does at present...?

PaulPaul

8:30 pm on Sep 9, 2002 (gmt 0)

10+ Year Member



I also use nested <div>, I dont know why tho :) CSS is the proper solution.

martinibuster

8:40 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Nick_W,

Indeed a good example and definitely preferable to tables because, among other reasons and correct me if I'm wrong, it takes less processing power/time to render than it does to render a table.

However, the border around the h1 doesn't render in NN 4.7. In fact, for some reason, it looks like either the css font formatting isn't taking hold on nn 4.7 or it just plain looks different.

I've made a choice to include NN 4.7 people for my site and so do some of my clients. Some clients don't care and for them I'll style it a little more modern.

I'm not really interested in doing sniffers and multiple pages for different browsers, however. Unless I'm being paid by the hour. :)

Nick_W

8:43 pm on Sep 9, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



strait HTML?

That is straight HTML. As defined by the w3c. There's nothing fancy about it, it's how you are supposed to write html documents.

As for 'faster to load' etc:

Yes. Build it with tables, see just how much more code you need. If you put that CSS in an external sheet you can call it on every page of your site and then:

  • You only have one file to edit to change the whole site's look and feel
  • The users browser caches it so only needs to download it once, making for fast, light page loads
  • Screen/text readers will have a lovely time with your nice cleanly marked up html documents. This is more demonstrable with a multi column layout as the 'code flow' is very hard to make sense with tables but a snap done properly with CSS and valid markup

how would i best get it so at say 800/600 it would display say 90% or 100% width, but once the window is resized and enlarged it then proportionatly scales like it does at present...?

Tricky, very tricky. I certainly wouldn't try to do that... JavaScript would be the way forward but why bother?

Just set those margins to 10% each and it will look pretty good an the most popular resolutions and like I said, those with high rez will be used to resizing their browsers anyway...

Liquid design - Valid code - CSS layouts - Accessibility etc is all one mindset. If you can get your mind round the idea of a fluid, changeable page you'll have lot's of fun. Rather than pixel tweaking all day every day.

Don't take my designs as good examples as I'm hopeless visually, I can't even pick nice colors. Have a look at the Mod's of this forums sites and some of the other CSS die hards that hang out here ;-)

<added>

takes less processing power/time to render than it does to render a table.

Damn right! Tables need two passes if they contain images and stuff I believe. If you're happy with your pages flowing into place as the browser interprets your styles (I love that!) then you're laughing ;)

NN4? What's that? ....just kidding, didn't even consider it in my example. It's a problem with the shorthand font declaration and not specifying a border rule for each border I believe...
</added>

Nick

Harley_m

12:18 am on Sep 10, 2002 (gmt 0)

10+ Year Member



nick, as always good suggestions, and you have certainly helped me choose the course to take, many thanks for that...

while were talking of layouts not working..what about the "start new thread" and "reply to thread" links on the bottom right...? hehe...

copongcopong

4:33 am on Sep 10, 2002 (gmt 0)

10+ Year Member



xhtml/css layout... A little investment of time and you'll never look back...

yeah! this is definitely a good one!

BlobFisk

10:31 am on Sep 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I know I'm coming in late with this, but align="<whatever>" is a deprecated tag in html4.01 and above...

ann

10:38 am on Sep 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<table width="100%"
border="2"
cellspacing="0"
cellpadding="4"
align="center"
bordercolor="#800000">

(this for the left margin)
<tr><td width="20%"
align="center"
valign="top"
bgcolor="#FEBBB1">

some text here
</td>

(this for the center area)
<td width="60%"
valign="top"
bgcolor="#DDEED1">
Some more text here
</td>

(this for the right margin)
<td width="20%"
align="center"
valign="top"
bgcolor="#FEBBB1">

Text here
</td></tr></table>

Works for me and in most browsers.

Ann

Nick_W

12:24 pm on Sep 10, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure, pretty good demonstration of how much extra code is involved with a table based solution though ;)

Nick

ann

5:53 am on Sep 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I gave up on css until all browsers support it...I need all the visitors I can get ! ;)

Ann

Nick_W

6:00 am on Sep 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Poor excuse Ann. I make sites every day with only CSS and so do lot's of other people. It's not really that difficult to use CSS on your sites.

With the notable exception of NN4 though! If your visitors show a high percentage of NN4 users then a table based layout is probably wht way you should go...

Nick

Eric_Jarvis

9:55 am on Sep 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



you could just as well say "I gave up on images until all browsers support them"...people who use text only or text to speech browsers aren't expecting to see pictures...people who use non-css browsers aren't expecting styled pages anymore...and people who use Netscape 4 are pretty used to peculiar or sparse layout and tend to be grateful if the site is simply usable

the idea of a site that is identical in all browsers was never a realisable goal...it's getting further away not closer...so my view is that it's far easier and far more effective to embrace the idea of a site looking very different to different users whilst remaining usable for all of them

ann

7:31 pm on Sep 11, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oh well,

You say tomatos and I say tamatoes....I use what I like and know the most about....I am not into the whole keeping up with what one browser shows and one doesn't...I like to call it the kiss system....my personal kiss system.

Some do, some don't, some will and some won't...what can I say...shoot me, I'm gonna go take a nap!
:)

Ann

martinibuster

7:52 pm on Sep 11, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi Ann,
That looks fine to me. I can't wait to get home and work with it. For many clients and audience, I have to keep it simple. I can't write off people who can't get it together to upgrade their browsers.

Of course, it's always smart to learn how to do it the CSS way, and I do. Ironically, it's easier to do good css than it is to do it with tables. And I wish I could skate along by sticking with it but reality dictates I have to, for some clients, stick with tables.

Oh no! Tomatoes again!

ann

2:10 am on Sep 12, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thank you martinibuster,

Yawn...I still haven't had my nap yet.

Ann

Edited by ann: If you go with the tables and decide to add a bottom table as I did in my page be sure you do not have a carriage return (white space) between the ending table tags and the beginning table tags...netscrape hates that.

colorspots

4:11 pm on Sep 13, 2002 (gmt 0)

10+ Year Member



I am in the process of redesigning a medium site with a wide variety of users. where is a good place to learn and research xhtml and css?

Harley_m

4:30 pm on Sep 13, 2002 (gmt 0)

10+ Year Member



w3schools.com is a great place to start...