Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Layout question

Layout question

Scheduled Pinned Locked Moved Web Development
questionwpftutorial
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Tomas Petricek
    wrote on last edited by
    #1

    Hi, is it possible to create web page layout like this:

    ______________________
    | | |
    | 100px | Width-100px |
    |<----->|<------------>|
    | | |
    | | |
    |_______|______________|

    using DIVs and styles ? I know how to divide page to two parts using width in percents but how to do this with pixels ? Thanks!:) i'm only pointer to myself

    P Z 2 Replies Last reply
    0
    • T Tomas Petricek

      Hi, is it possible to create web page layout like this:

      ______________________
      | | |
      | 100px | Width-100px |
      |<----->|<------------>|
      | | |
      | | |
      |_______|______________|

      using DIVs and styles ? I know how to divide page to two parts using width in percents but how to do this with pixels ? Thanks!:) i'm only pointer to myself

      P Offline
      P Offline
      Paul Watson
      wrote on last edited by
      #2

      Do you mean 100% in the second block, not 100px?

      Paul Watson
      Bluegrass
      Cape Town, South Africa

      Crikey! ain't life grand?

      T 1 Reply Last reply
      0
      • P Paul Watson

        Do you mean 100% in the second block, not 100px?

        Paul Watson
        Bluegrass
        Cape Town, South Africa

        Crikey! ain't life grand?

        T Offline
        T Offline
        Tomas Petricek
        wrote on last edited by
        #3

        I mean something like this (but without table):

        <table width="100%">
        <tr>
        <td width="100px"> Left... </td>
        <td> Right... </td>
        </tr>
        </table>

        i'm only pointer to myself

        P 1 Reply Last reply
        0
        • T Tomas Petricek

          Hi, is it possible to create web page layout like this:

          ______________________
          | | |
          | 100px | Width-100px |
          |<----->|<------------>|
          | | |
          | | |
          |_______|______________|

          using DIVs and styles ? I know how to divide page to two parts using width in percents but how to do this with pixels ? Thanks!:) i'm only pointer to myself

          Z Offline
          Z Offline
          ZoogieZork
          wrote on last edited by
          #4

          <style type="text/css"><!--
          body {
          margin: 0 0 0 0;
          }
          div.nav {
          position: absolute;
          width: 100px;
          background-color: #dfdfdf;
          height: 100%;
          }
          div.content {
          position: relative;
          left: 100px;
          right: 0;
          background-color: #7f7f7f;
          height: 100%;
          }
          --></style>

          <div class="nav">
          Asparagus
          </div>

          <div class="content">
          Content
          </div>

          - Mike

          P 1 Reply Last reply
          0
          • T Tomas Petricek

            I mean something like this (but without table):

            <table width="100%">
            <tr>
            <td width="100px"> Left... </td>
            <td> Right... </td>
            </tr>
            </table>

            i'm only pointer to myself

            P Offline
            P Offline
            Paul Watson
            wrote on last edited by
            #5

            Ok, so a fixed width left column and the a variable width content column. Sure, use this:

            <div id="navigation">
            <ul>
            <li><a title="Page link" href="">Page 1</a></li>
            <li><a title="Page link" href="">Page 2</a></li>
            <li><a title="Page link" href="">Page 3</a></li>
            <li><a title="Page link" href="">Page 4</a></li>
            <li><a title="Page link" href="">Page 5</a></li>
            <li><a title="Page link" href="">Page 6</a></li>
            </ul>
            </div>
            <div id="content">
            <h1>Page Title</h1>
            <p>Content content content content content content content content content content content content content content content content content.</p>
            <p>Content content content content content content content content content content content content content content content content content.</p>
            <p>Content content content content content content content content content content content content content content content content content.</p>
            <p>Content content content content content content content content content content content content content content content content content.</p>
            </div>

            and then CSS:

            div#navigation
            {
            width: 100px;
            float: left;
            border: solid 1px #000000;
            height: 100%;
            }

            div#content
            {
            padding-left: 120px;
            border: solid 1px #000000;
            }

            So the idea is to have a DIV on the left with float:left set and a fixed width. Then the DIV on the right expands to fill the space. The padding-left: 120px; keeps it off the left DIV.

            Paul Watson
            Bluegrass
            Cape Town, South Africa

            Crikey! ain't life grand?

            T 1 Reply Last reply
            0
            • P Paul Watson

              Ok, so a fixed width left column and the a variable width content column. Sure, use this:

              <div id="navigation">
              <ul>
              <li><a title="Page link" href="">Page 1</a></li>
              <li><a title="Page link" href="">Page 2</a></li>
              <li><a title="Page link" href="">Page 3</a></li>
              <li><a title="Page link" href="">Page 4</a></li>
              <li><a title="Page link" href="">Page 5</a></li>
              <li><a title="Page link" href="">Page 6</a></li>
              </ul>
              </div>
              <div id="content">
              <h1>Page Title</h1>
              <p>Content content content content content content content content content content content content content content content content content.</p>
              <p>Content content content content content content content content content content content content content content content content content.</p>
              <p>Content content content content content content content content content content content content content content content content content.</p>
              <p>Content content content content content content content content content content content content content content content content content.</p>
              </div>

              and then CSS:

              div#navigation
              {
              width: 100px;
              float: left;
              border: solid 1px #000000;
              height: 100%;
              }

              div#content
              {
              padding-left: 120px;
              border: solid 1px #000000;
              }

              So the idea is to have a DIV on the left with float:left set and a fixed width. Then the DIV on the right expands to fill the space. The padding-left: 120px; keeps it off the left DIV.

              Paul Watson
              Bluegrass
              Cape Town, South Africa

              Crikey! ain't life grand?

              T Offline
              T Offline
              Tomas Petricek
              wrote on last edited by
              #6

              Thank you ! :) i'm only pointer to myself

              1 Reply Last reply
              0
              • Z ZoogieZork

                <style type="text/css"><!--
                body {
                margin: 0 0 0 0;
                }
                div.nav {
                position: absolute;
                width: 100px;
                background-color: #dfdfdf;
                height: 100%;
                }
                div.content {
                position: relative;
                left: 100px;
                right: 0;
                background-color: #7f7f7f;
                height: 100%;
                }
                --></style>

                <div class="nav">
                Asparagus
                </div>

                <div class="content">
                Content
                </div>

                - Mike

                P Offline
                P Offline
                Paul Watson
                wrote on last edited by
                #7

                That is a pretty cool way of doing it as well Mike. I really need to remember absolute positioning more.

                Paul Watson
                Bluegrass
                Cape Town, South Africa

                Crikey! ain't life grand?

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups