position divs for a simple three colunm layout

css , xhtml Iran
  • 13 years ago

     i have been studying website design for just over a year i previously used tables as a way of layout

    but now i want to get to the nuts and bolts and start using purely css and html i have been trawling through code and now finally get the jist.

     my question is why cant i sit a div in the middle of two column here is the code  i have been working on

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    <link href="style.css" rel="stylesheet" type="text/css" />

    <div id="wrap">
      <div id="header"></div>
      <div id="sidebar2">Content for  id "sidebar2" Goes Here</div>
     <div id="main">
        <div id="sidebar1">Content for  id "main" Goes Here    </div>

  • 13 years ago

    Hi there,

            <div style="background-color: Gainsboro; width: 100%; height: 100%;">
    <div style="background-color: Gray; width: 100%; height: 20px;">
    <div style="background-color: #990000; width: 200px; height: 100%; float: left;">

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“There's no test like production” - Anon