473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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*********@despammed.com> http://getinspired.at
Jul 20 '05 #1
4 2988
Maybe assigning
width: auto;
to the content DIV might make it center--or negative margins?

best,
xtort

Juergen Lang <ge*********@despammed.com> wrote in message news:<10***************@news.liwest.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:relative, 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{width:950px;margin:0px auto;text-align:left;}
#left{width:50px;}
#main{width:850px;}
#main{width:50px;}
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(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!
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(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!


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*********@despammed.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*********@despammed.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
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...
7
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...
9
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...
1
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...
15
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...
2
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...
1
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...
15
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...
5
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.