![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
BG 1 | Content | BG 3 | +------+ +------+ | | | | | ~~~~~~~~~~~~~~~~~~~~ |
#2
| |||
| |||
|
|
Hello! I want to style a layout without the use of tables. Instead of tables, I would like to use styled div-tags. The Layout is (or better: should be) as follows: +--------------------------------+ | BG 1 | Content | BG 3 | +------+ +------+ | | | | | | | | | | ~~~~~~~~~~~~~~~~~~~~ BG 1 and BG 2 are different images. The "Content" area has a width of 850px and should be centered! Left and right space from the "Content" area should be filled with those two background images. This was my first attempt: Style: ----------------------------------------------------------------------- div#main-lft { postion: relative; background: url('images/bg_lft.jpg'); background-repeat: repeat-x; height: 78px; float: left; } div#main-mid { width: 851px; postion: relative; margin: 0px auto auto auto; border-right: 1px solid white; border-bottom: 1px solid white; border-left: 1px solid white; float: left; } div#main-rgt { postion: relative; background: url('images/bg_rgt.jpg'); background-repeat: repeat-x; height: 78px; float: left; } HTML: ----------------------------------------------------------------------- div id="main" div id="main-lft"> </div div id="main-mid">Content</div div id="main-rgt"> </div /div The items are now positioned like they should be, but the "Content" area is not centered and the background areas do not fill the rest of the screen?! Now, does anybody have an idea of how to solve this layout problem? Thank you very much in advance, Juergen |
#3
| ||||
| ||||
|
|
Hello! I want to style a layout without the use of tables. Instead of tables, I would like to use styled div-tags. The Layout is (or better: should be) as follows: +--------------------------------+ | BG 1 | Content | BG 3 | +------+ +------+ | | | | | | | | | | ~~~~~~~~~~~~~~~~~~~~ BG 1 and BG 2 are different images. The "Content" area has a width of 850px and should be centered! Left and right space from the "Content" area should be filled with those two background images. This was my first attempt: |
|
postion: relative; postion: relative; postion: relative; |
|
The items are now positioned like they should be, but the "Content" area is not centered and the background areas do not fill the rest of the screen?! |
|
Now, does anybody have an idea of how to solve this layout problem? Thank you very much in advance, Juergen |
#4
| |||
| |||
|
|
Ah, so the pictures on the left and right should be larger when the window is larger and smaller if the window is smaller... |
|
Okay: HTML: div id="container" div id="inner" div id="main"></div /div /div CSS: #container{ background-image:url(leftimage.jpg); background-position:top left; background-repeat:no-repeat; /*or repeat-y*/ } #inner{ background-image:url(rightimage.jpg); background-position:top right; background-repeat:no-repeat; /*or repeat-y*/ text-align:center; } #main{ width:850px; margin:0 auto; text-align:left; } NOT tested! |
#5
| |||
| |||
|
|
Maybe assigning width: auto; to the content DIV might make it center--or negative margins? |
![]() |
| Thread Tools | |
| Display Modes | |
| |