Web Design Forum: 3 column html+css with proper source order (2-1-3) - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

3 column html+css with proper source order (2-1-3)

#1 User is offline   grumpykate 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 31
  • Joined: 12-September 08
  • Reputation: 0
  • Gender:Female
  • Location:Essex UK
  • Experience:Beginner
  • Area of Expertise:Designer

Posted 08 February 2010 - 04:47 PM

Can anyone help with an html+css to give the columns in the right order for SEO. I want the middle column (which appears 3rd in my html) to be first. I have fixed width columns and fluid middle. . . Point me in the right direction???

Thanks
Kate
0

#2 User is offline   Faevilangel 

  • Wordpress Ninja.....
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,166
  • Joined: 11-May 09
  • Reputation: 57
  • Gender:Male
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 08 February 2010 - 05:22 PM

You need to rewrite and do it with css, the following would work

html
 <div class="column" id="left">
  content
 </div>
 <div class="column" id="middle">
  content
 </div>
 <div class="column" id="right">
  content
 </div>


css
 .content {
  float:left;
  width:300px;
 }
 #left {
  margin-right:25px;
 }
 #middle {
  margin-right:25px;
 }
 #right {
 }


The brilliance of the code above, is that it is so easy to edit the columns, you can add a different colour to each, add different widths and any other css attributes. You need to keep the "float:left" as it makes all of the columns appear in a line.

Hope that helps
0

#3 User is offline   grumpykate 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 31
  • Joined: 12-September 08
  • Reputation: 0
  • Gender:Female
  • Location:Essex UK
  • Experience:Beginner
  • Area of Expertise:Designer

Posted 08 February 2010 - 05:32 PM

Thanks but have I explained myself. . . ? Columns left and right will just have pictures in them. The centre column will have all the text - therefore for SEO and search purposes I want the text (the middle column) to be first in the html..

<div id="center">
Blah blah
</div>

<div id="left">
pictures
</div>

<div id="right">
pictures
</div>


Will what you have given me work?

cheers

Kate
0

#4 User is offline   empek 

  • Wordpress Geek
  • PipPipPipPip
  • Group: Members
  • Posts: 774
  • Joined: 17-December 08
  • Reputation: 75
  • Gender:Male
  • Location:New York City.
  • Experience:Web Guru
  • Area of Expertise:Designer/Coder

Posted 08 February 2010 - 06:25 PM

I would recommend you go with what Faevilangel said.

The only way you can get this to work is by using absolute positioning, but things get messy really quickly that way.

You wont sacrifice much SEO if you have the sidebar come before the content.
0

#5 User is offline   grumpykate 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 31
  • Joined: 12-September 08
  • Reputation: 0
  • Gender:Female
  • Location:Essex UK
  • Experience:Beginner
  • Area of Expertise:Designer

Posted 09 February 2010 - 12:02 PM

Makes my life easier! Thanks for the advice.
0

#6 User is offline   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,839
  • Joined: 14-February 08
  • Reputation: 168
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 09 February 2010 - 01:15 PM

There is a way you can do this, although it's not as clean as I'd like. What you need to do is enclose the main content (middle) and the left column in a div of their own, and float it left. Float the right column to the right, then position the main content and left column within their own div like so:

<div id="2col">
<div id="centre">
<!-- main content -->
</div>
<div id="left">
</div>
</div> <!-- 2col ends -->
<div id="right">
</div>

#2col {width:720px;float:left;}
#centre {width:480px;float:right;}
#left {width:240px;float:left;}
#right {width:240px;float:right;}


Hope that helps :)
0

#7 User is online   BlueDreamer 

  • Web Guru
  • Group: Moderators
  • Posts: 5,674
  • Joined: 23-October 07
  • Reputation: 192
  • Gender:Male
  • Location:Northampton (where?)
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 09 February 2010 - 01:26 PM

notbanksy employs the Doug Bowman method - good to see :)
0

#8 User is offline   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,839
  • Joined: 14-February 08
  • Reputation: 168
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 09 February 2010 - 01:35 PM

Who's this doug bowman then? I was just using my noggin! :p
0

#9 User is online   BlueDreamer 

  • Web Guru
  • Group: Moderators
  • Posts: 5,674
  • Joined: 23-October 07
  • Reputation: 192
  • Gender:Male
  • Location:Northampton (where?)
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 09 February 2010 - 01:54 PM

He's one of the original "CSS gurus" - watch this video about CSS layout techniques - he demonstrates the same method in there
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users