2 Column webpages HTML / CSS code
We will now create a standard 2 column HTML / CSS web page. Simply copy and paste the code in the form below. Save as a .html file then open it in your browser - it will look like this: 2 col layout
Actually, we'll deal with two CSS methods here that generate the same layout consisting of a top header 800px, a left column 150px wide and a main content area 650px wide. Fairly standard layout... but very useful. The first method uses an internal style sheet, the second uses an external style sheet.
Internal Style Sheet Example
The first example generates the layout using an internal CSS style sheet. This code is contained in between the :
<style></style> tags
Here's the code using an internal CSS style sheet.
Copy > Paste into a notepad file > Save as something.html to your desktop > Then "open with IE" or what ver browser you wish...
Ok...that works pretty well...the page opened and seems like a useful layout. But wait...
What if our website will potentially contain 500 pages? Updating would be a nightmare!
The CSS code that is embedded into the HTML file with the Internal Style sheet controls the entire layout of the page using CSS from within the single page. It controls all styles such as: text, font size, font color, column width, header width etc...
Now... say you want to make a change in the font size, you feel it's too small and need to increase it a few pixels. With a display being controled by an internal style sheet you'll need to modify the CSS on all 500 pages; that is... make your changes to your CSS tags within the head section of each and every page. Of course that's absurd!
So what do we do to make editing site-wide changes easier? We us an external style sheet.
External Style Sheet Example
We will now place all the CSS code which controls that presentation of our web pages in ONE file. written like this:
<link href="style-basic.css" rel="stylesheet" type="text/css"/>
This file, style-basic.css, will be referenced from every page of our 500 page website. The advantage of this? If we want to increase our font size now we simply edit ONE .css file. Since we include a reference to our external .css file on in every web page all .css presentation changes are site-wide - global.
Enough chitter chatter...let's do it! All you need to do is copy and paste these files below.
First copy and paste this code below into notepad - name it style-basic.css.
NEXT copy and paste this code below into notepad - name it 2-col.html
Open and view
With your 2 files saved in the same folder you will now open them in a browser. Simply locate the folder on your harddrive - right click on 2-co.html and click open with IE or whicever browser you wish. The file will open as a "web page"
External Style Sheet Is The Way To Go
It should be quite obvious that an external style sheet makes site wide changes a breeze. I would urge anyone interested in web design to have a thorough working knowledge of CSS and external style sheets. New designers are expected to know CSS. The positive impact it has on site layout, site design as well as SEO is tremendous.
If you are interested in learning CSS in a structured way, there are many online resources to get you up to speed on this somewhat confusing technology - Eric Meyer comes to mind, but there are many other great teachers and methods instantly available online.
Review the web building process: build web site free
Was this helpful? Leave a comment...
Please leave your comment...name or email is not required. If you leave your email we WILL respect your privacy and not spam you. We may update you occasionally with value added info related to web building, web design, CSS, HTML. Thanks!
Comments...
Comment posted on : 9/28/2009 4:31:24 AM
Да уж...
poster: kinozalvip
--------------------------------------------------------
Comment posted on : 9/26/2009 6:24:55 AM
Обновили всю коллекцию фильмов для онлайн просмотра. http://1id.ru
poster: FilmsVipOnline
--------------------------------------------------------
Comment posted on : 9/19/2009 6:18:50 AM
Very nice site!
poster: Pharmd556
--------------------------------------------------------
Comment posted on : 9/19/2009 6:18:47 AM
Very nice site! cheap cialis http://aieopxy.com/osoxayv/4.html
poster: Pharmd720
--------------------------------------------------------
Comment posted on : 9/19/2009 6:18:46 AM
Very nice site! [url=http://aieopxy.com/osoxayv/2.html]cheap cialis[/url]
poster: Pharmc102
--------------------------------------------------------
Comment posted on : 8/6/2009 3:56:06 AM
1800s system paper primary smaller points
poster: niewhealls
--------------------------------------------------------
Comment posted on : 8/6/2009 3:55:49 AM
rss extreme http://www.summitsource.com http://myweb.accessus.net http://www.washingtonpost.com
poster: millerlaki
--------------------------------------------------------
Comment posted on : 8/6/2009 3:55:32 AM
business science radiative [url=http://www.anthraxinvestigation.com]cap differing consensus cycle modeling[/url] [url=http://www.orthodoxytoday.org]century dissolved developed rss[/url] [url=http://features.csmonitor.com]term 2000[/url] [url=http://climateprogress.org]comments influence dimming geoengineering gps[/url]
poster: alsatiacru
--------------------------------------------------------
Comment posted on : 8/6/2009 3:54:52 AM
change cfcs indicate revolution app species
poster: carswellpe
--------------------------------------------------------
Comment posted on : 8/3/2008 12:08:12 PM
Jim the easiest way is to open the style sheet - style-basic.css and change this line - color:#333;you just enter the hex # you want for the color #333 is a dark grey of course - hope that helps...
poster: admin
--------------------------------------------------------
Comment posted on : 8/23/2009 6:40:01 AM
Very nice site!
poster: Pharme170
--------------------------------------------------------
Comment posted on : 8/23/2009 6:39:57 AM
Very nice site! cheap cialis http://apxyieo.com/qyoxxs/4.html
poster: Pharmd31
--------------------------------------------------------
Comment posted on : 8/23/2009 6:39:55 AM
Very nice site! [url=http://apxyieo.com/qyoxxs/2.html]cheap cialis[/url]
poster: Pharmg257
--------------------------------------------------------
Comment posted on : 8/2/2008 11:42:37 PM
In the build website free tutorial above - how do you change font colors?
poster: Jim
--------------------------------------------------------
Comment posted on : 7/30/2008 6:58:51 PM
great info for someone who doesn't have a ton of time to learn web design - I am using the 2col layout withthe include menu - I may dig deeper into learning asp
poster: Amanda
--------------------------------------------------------
Comment posted on : 6/29/2009 5:13:24 PM
CIALIS Comprar VIAGRA Venta LEVITRA Adelgazar: ACOMPLIA, XENICAL, CIALIA (Cialis en laminas solubles) y GENEGRA (Viagra en laminas solubles)
[url=http://forum.studenti.it/members/krex.html] Cialis online[/url]
[url=http://www.cittaeducativa.roma.it/moodle/user/view.php?id=2780&course=1]comprar Cialis generico[/url]
[url=http://www.cittaeducativa.roma.it/moodle/user/view.php?id=2783&course=1] Cialis online[/url]
[url=http://forum.studenti.it/members/kanvo.html]comprar Cialis generico[/url]
[url=http://forum.studenti.it/members/recons.html] Cialis generico[/url]
Online pharmacy offering FDA approved prescription drugs. Buy branded drugs and their generic equivalents from your international leading pharmacy at
poster: Beksweemy
--------------------------------------------------------
Comment posted on : 2/12/2009 11:07:58 PM
You would get more comments if you let us put in our url.
poster: Rick
--------------------------------------------------------
Comment posted on : 10/30/2009 5:53:38 AM
ребят смотрите тут,вроде норм - filmkolor.ru
poster: byryndychek
--------------------------------------------------------
Comment posted on : 10/22/2009 9:37:16 PM
Very nice site!
poster: Pharme344
--------------------------------------------------------
Comment posted on : 10/22/2009 9:37:10 PM
Very nice site! cheap cialis http://ypxaieo.com/rrqavao/4.html
poster: Pharmc472
--------------------------------------------------------
Comment posted on : 10/22/2009 9:37:03 PM
Very nice site! [url=http://ypxaieo.com/rrqavao/2.html]cheap cialis[/url]
poster: Pharmd325
--------------------------------------------------------