Webmaster Key - Discussion Forums


Welcome, Guest. Please login or register.
Did you miss your activation email?
February 09, 2012, 10:55:56 AM

Login with username, password and session length
Welceome to Forums!

Important information for guests and new members:

In order to understand the full benefits of becoming an active member of this forum, please review the following information on guest and new member restrictions. These forum changes have been prompted by an overwhelming and unreasonable amount of bot postings and incoherent guest spam messages. We wish to prevent these events from happening in the future and make our community a more comfortable place for all of our members.

For guests:

Guests are not allowed to open new topics, polls, or posts attachments.
If you wish to open up new discussions on this forum, we encourage you to register.

For new members:

New members with less than five posts are not allowed to modify additional profile information such as avatars, contact information, biographies, and signatures. However, new members are encouraged to post their own topics or reply to topics initiated by other members. Become active on the forums and 5 posts should be an easy task!

We are a diverse community with members from all over the world. We encourage new ideas and interesting conversation. Do not be afraid to post webmaster/computer-related questions or problems, as our active members are always willing to help when they are able. Interested? Join us.

+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ CSS Code for 3-column page
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print
Author Topic: CSS Code for 3-column page  (Read 3176 times)
Andy
Administrator
Veteran
*****
Posts: 5 752



« on: June 28, 2005, 10:03:30 PM »

I would be interested if anyone has managed to create cross-browser compatible code for a 3-column page with header and footer using CSS. If you try and do this you find all sorts of problems when you switch between say Firefox and IE6 and you resize the browser window.

In the end, I decided to use a table for the columns so they don't wrap around.

Here is the page template I came up with:


<html>
<head>
<title>CSS Positioning</title>
<style>

body {
  margin: 0px;
}

#header {
  position: absolute;
  top: 0px;
  left: 0px;
  color: #000;
  background: #999;
}

#container {
  position: absolute;
  top: 50px;
  left: 10px;
  color: #000;
  background: #ddd;
}

#footer {
  color: #fff;
  background: #009;
  text-align: center;
}

div #left {
  width: 100px;
  background: #3ff;
}

div #middle {
  background: #f3f;
}

div #right {
  width: 100px;
  background: #ff3;
}

</style>
</head>
<body>

<div id="container">
<table width="100%" border=1>
<tr>

<td width=150 valign="top">
<div id="left">
Left<br>
Left<br>
Left<br>
Left<br>
Left<br>
Left<br>
Left<br>
Left<br>
Left<br>
Left<br>
</div>
</td>

<td valign="top">
<div id="middle">
Middle<br>
Middle<br>
</div>
</td>

<td width=150 valign="top">
<div id="right">
Right
</div>
</td>

</tr>
</table>

<div id="footer">
Footer
</div>
</div>

<div id="header">
Header
</div>

</body>
</html>


The style code would normally be in a separate style sheet file. You may notice that the header html is at the bottom of the code even though it is displayed at the top of the page.

This code is handy for experimenting with the effects of changing width parameters etc. I set the table border 'on' with a width of 1 so you can see the actual table dimensions even when the <div> blocks are smaller than the table cells. i.e. the left div is 100px wide but the table cell is 150px wide.
Report to moderator   Logged

donecweb
Administrator
Veteran
*****
Posts: 1 303


DonecWeb


« Reply #1 on: June 28, 2005, 11:12:08 PM »

Here is a demo site made by a Guru from statcounter forum and it seems to fit you request perfectly.
http://www.jonra.com/css-demos/css-flexible.html

DonEc
Report to moderator   Logged

DonEc Web

Links and accurate information provide the best answer, while garbage in provides garbage out.
Andy
Administrator
Veteran
*****
Posts: 5 752



« Reply #2 on: June 28, 2005, 11:39:48 PM »

Thanks Don, at first examination it does seem to achieve the results. :-)
Report to moderator   Logged

donecweb
Administrator
Veteran
*****
Posts: 1 303


DonecWeb


« Reply #3 on: June 29, 2005, 04:04:29 AM »

I have been messing with it for a few days trying to learn and have made several pages using similar methods and have learned quite a lot and still know nothing.  Grin

Here is another site he has that has some more examples of CSS that I have found interesting.
http://www.jonra.com/css-demos/css-1-column-layout.html#

DonEc

Report to moderator   Logged

DonEc Web

Links and accurate information provide the best answer, while garbage in provides garbage out.
Andy
Administrator
Veteran
*****
Posts: 5 752



« Reply #4 on: June 29, 2005, 10:34:11 PM »

Yeah, I surfed jonra.com and checked out the examples, they are good and it's unfortunate this guy has not optimized his pages for search engines to get traffic. But now we have some links to him/her, hopefully it'll change.

In the end I went for a combination of css and tables. This is because I couldn't make my own custom version work only with css.

I developed my own trick  Smiley

You can use a div to push content down the page so you can later on place an absolutely positioned block in that place. This is for SEO reasons where the header and navigation code is best placed below content code.
Report to moderator   Logged

donecweb
Administrator
Veteran
*****
Posts: 1 303


DonecWeb


« Reply #5 on: June 30, 2005, 04:43:48 AM »

Jonra is working on a complete demo section on CSS for his site but it is not ready yet. What I showed you were just some of his examples he uses when helping people at statcounter.

DonEc
Report to moderator   Logged

DonEc Web

Links and accurate information provide the best answer, while garbage in provides garbage out.
Andy
Administrator
Veteran
*****
Posts: 5 752



« Reply #6 on: July 27, 2005, 10:29:35 PM »

I finally worked it out. Once I tidy my code I will post, but here is what sparked me off on the quest to understand how it works: http://www.bubblessoc.net/skins/ This site is table-less css but still not good enough since it's not fluid!

They use fixed width columns. For fluid sites, you have to use percentage settings for column widths.

I have produced some pages with selectable skins which have totally eradicated any tables. Stand by...

http://aweconsulting.co.uk/ On the right of the page is a drop-down selection for the skins.
« Last Edit: November 10, 2006, 01:30:02 PM by Andy » Report to moderator   Logged

Pages: [1] Go Up Stumble Upon! Digg It! del.icio.us! Add to Technorati! ReddIt!  Send this topic Print 
+ Webmaster Key Forums
|-+ Webmaster Corner
| |-+ Site Design and Web Authoring
| | |-+ CSS Code for 3-column page

Jump to:  
« previous next »


Our Partners
RelmaxTOP Ranking System Web Hosting RelmaxTOP Ranking System
Staff Sites
12Noon[12Noon Gallery] Andy[Urgentclick]
Tamuril[Tamuril's Digital Art Exhibit] Sensovision
Powered by MySQL Powered by PHP We are hosted by Relmax Inc. |Our Privacy Policy | Sitemap
Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC
Forum design by Tamuril © 2005.
Valid XHTML 1.0! Valid CSS!