473,782 Members | 2,419 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with layouting without tables

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">&nbsp;</div>

<div id="main-mid">Content</div>

<div id="main-rgt">&nbsp;</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

--
Juergen Lang <ge*********@de spammed.com> http://getinspired.at
Jul 20 '05 #1
4 3003
Maybe assigning
width: auto;
to the content DIV might make it center--or negative margins?

best,
xtort

Juergen Lang <ge*********@de spammed.com> wrote in message news:<10******* ********@news.l iwest.at>...
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">&nbsp;</div>

<div id="main-mid">Content</div>

<div id="main-rgt">&nbsp;</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

Jul 20 '05 #2
Els
Juergen Lang wrote:
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:
[snip code]
postion: relative;
postion: relative;
postion: relative;
Besides not needing position:relati ve, it wouldn't work with
the missing i in the word...

As the left and right 'area' are only to hold pictures, I
suppose you need this:

html:
<div id="container" >
<div id="left"></div>
<div id="main"></div>
<div id="right"></div>
</div>

Assuming each picture is 50px wide:

CSS:
body{text-align:center;}
#container{widt h:950px;margin: 0px auto;text-align:left;}
#left{width:50p x;}
#main{width:850 px;}
#main{width:50p x;}
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?!
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(lefti mage.jpg);
background-position:top left;
background-repeat:no-repeat; /*or repeat-y*/
}
#inner{
background-image:url(right image.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!
Now, does anybody have an idea of how to solve this layout
problem?

Thank you very much in advance,
Juergen



--
Els
http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Jul 20 '05 #3
Hello!
Ah, so the pictures on the left and right should be larger
when the window is larger and smaller if the window is
smaller...
That's right ...
Okay:

HTML:

<div id="container" >
<div id="inner">
<div id="main"></div>
</div>
</div>

CSS:

#container{
background-image:url(lefti mage.jpg);
background-position:top left;
background-repeat:no-repeat; /*or repeat-y*/
}
#inner{
background-image:url(right image.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!


Very good idea!
The only problem with this is, that the rightimage.jpg lays over the
leftimage.jpg along the whole width of the screen, because I have to use
repeat-x (BG-tile).
Now my *working* solution (based on yours) is as follows:

CSS:

#container{
background-image: url('images/bg_rgt.jpg');
background-position: top right;
background-repeat: repeat-x;
}
#inner{
background-image: url('images/bg_lft.jpg');
background-position: top left;
background-repeat: no-repeat;

}
#main{
width: 851px;
margin: 0px auto auto auto;
border-left: 1px solid white;
border-right: 1px solid white;
border-bottom: 1px solid white;
height: 78px;
}

HTML:

<div id="container" >

<div id="inner">

<div id="main">test </div>

</div>

</div>

'bg_lft.jpg' now has a fixed width of 550px, so that (even on very high
screen resolutions) it overlays images/bg_rgt.jpg for the width of 525px
and then 'images/bg_rgt.jpg' begins. Both are overlayed with the 'main'
area!

Not the finest way, but ... a working way.

Thank you very much!

--
Juergen Lang <ge*********@de spammed.com> http://getinspired.at
Jul 20 '05 #4
Hello!
Maybe assigning
width: auto;
to the content DIV might make it center--or negative margins?


Funnily, assigning a width of 'auto' does not solve the problem.
The browser makes 'auto' to the full width of the current window, so
that the next <div> tag begins in the next row. :\

Thank you,
Juergen Lang
--
Juergen Lang <ge*********@de spammed.com> http://getinspired.at
Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1488
by: Steve Bishop | last post by:
I have this stored proc that is to look for changes only between 2 tables and inserts the changes into one of my temp tables that I later delete in my DTS flow. I am running into a problem I think becasue in my query I am joining on fields that may not exist yet in one of the tables. Is there a way to compare the 2 tables in the query without joining them? Here is my current query:
7
5942
by: mr_burns | last post by:
hi, is the table percent value for height used for displaying in browsers. i have a table i want to run to the bottom of the screen so it seemed best to set the height value to 100%. when i display the table, it only sizes to the elements nested inside the table (as if no value for height has been given) and not to the bottom of the screen. i have also tried appling the height attribute as a css class but no joy.
9
4077
by: Dustin | last post by:
Here's what I am trying to do: (Names represent CSS classes.) I want to create a photo gallery. I want the entire gallery to be surrounded by a box named PhotoGallery. I want a fluid placement of the individual Items within PhotoGallery. An Item is a box that has two child boxes, PhotoBox and Caption. Photobox has an explicit width and height. PhotoBox contains an image whose dimensions may vary, but are constrained to be within...
1
3470
by: Mithun Verma | last post by:
Hello All, I have a Windows application that uses Crystal Reports 9 (bundled Version) developed using VS.NET 2003 on a windows server 2003 m/c. The application has to be deployed on the client machine that has Windows XP installed. Before deploying we make sure that .NET framework 1.1 is installed on the XP machine. In the setup project, for support for Crystal Reports, we have added the following merge modules: 1)Crystal_Managed2003.msm...
15
2325
by: Tamblyne | last post by:
This problem has got to have a simple solution and I can't be the first person who has ever handled it. Perhaps Google is no help because I'm not using the right terms? (I did find one post on-point, but no one responded to it.) I have a two column layout with a header and a footer. If the "content" is longer than the "navigation", there is no problem. However, if the content is shorter than the navigation, the navigation menus...
2
2694
by: Robert McGregor | last post by:
Hi all, I've got a Front End / Back End database that was working just fine. One day i opened the FE to find that if I tried to open one of the linked tables from the database window, nothing happened (hourglass for about 2 seconds then nothing). I tried relinking the tables and got the same response. (Access even completely bombed out once with a Dr Watson failure).
1
1893
by: Kristina | last post by:
I'm trying to run multiple append queries in an Access front end that append data from tables in a .mdb into tables in SQL Server 2000. My Access front end has a link to both tables, the .mdb and the SQL Server. What happens is that I run the first query, and it runs without problem. When I run the second query, I get an error that there is a key violation on every record in that table. However, if I exit my front end application,...
15
2459
by: srampally | last post by:
The following code works in firefox. But IE displays the hyperlink at font-size=13 rather than font-size=10. Why? If its a known IE bug, how should I fix it? I always want the hyperlinks to take the size of the next parent element's class. thanks for the help, Shashi
5
2059
by: Edward | last post by:
I've been running into issue after issue trying to position text with pure CSS (ie 3-pixel bug, margin bugs, inexplainable side-effects, etc.). I noted that I can just put an HTML table anywhere I want on the screen, set DIVs inside there, and for the most part, I get the structure I want quickly and can continue to use my style sheet for the divs. And as far as I understand, even though this is not pure separation of design and content,...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7494
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.