473,503 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with layout

I'm trying to create the following layout and would appreciate help.

+----------------+
| header | variable height
+------+---------+
| | stuff | 150 pixels, content variable height & centered vertically
| +---+---------+
| | more |
| | |
+--+-------------+
| footer |
+----------------+

Also, the area to the left of 'stuff' and 'more' will have a background
image that visually wraps around the top left corner of 'more'.

The vertical centering inside 'stuff' is a standard problem, I think. The
only (cross-browser) approaches I know are to either use tables (yuck) or
nest a div or two using display:table and display:table-cell (yuck again).

I think I can do it by enclosing each of 'stuff' and 'more' in a full-width
div with left padding, fixing the height for the div containing 'stuff', and
displaying the background image in both enclosing divs. But this seems kind
of ugly. Is there a better way?

TIA

Ted Hopp
Feb 4 '07 #1
4 1993
In article <Nv******************************@rcn.net>,
"Ted Hopp" <te*@zigzagworld.comwrote:
I'm trying to create the following layout and would appreciate help.

+----------------+
| header | variable height
+------+---------+
| | stuff | 150 pixels, content variable height & centered vertically
| +---+---------+
| | more |
| | |
+--+-------------+
| footer |
+----------------+

Also, the area to the left of 'stuff' and 'more' will have a background
image that visually wraps around the top left corner of 'more'.

The vertical centering inside 'stuff' is a standard problem, I think. The
only (cross-browser) approaches I know are to either use tables (yuck) or
nest a div or two using display:table and display:table-cell (yuck again).

I think I can do it by enclosing each of 'stuff' and 'more' in a full-width
div with left padding, fixing the height for the div containing 'stuff', and
displaying the background image in both enclosing divs. But this seems kind
of ugly. Is there a better way?

TIA

Ted Hopp
Why don't you show us your best shot and we go from there. URL

--
dorayme
Feb 4 '07 #2
On 2007-02-04, Ted Hopp <te*@zigzagworld.comwrote:
I'm trying to create the following layout and would appreciate help.

+----------------+
| header | variable height
+------+---------+
| | stuff | 150 pixels, content variable height & centered vertically
| +---+---------+
| | more |
| | |
+--+-------------+
| footer |
+----------------+

Also, the area to the left of 'stuff' and 'more' will have a background
image that visually wraps around the top left corner of 'more'.

The vertical centering inside 'stuff' is a standard problem, I think. The
only (cross-browser) approaches I know are to either use tables (yuck) or
nest a div or two using display:table and display:table-cell (yuck again).
Right, I think those are basically your cross-browser options.

I thought Spartanicus had a good page about vertical centering, but I
couldn't find it.

Bottom line is that vertical centering of a little auto-height block of
text requires inline-block or table. If the height's not auto there are
more options.
I think I can do it by enclosing each of 'stuff' and 'more' in a full-width
div with left padding, fixing the height for the div containing 'stuff', and
displaying the background image in both enclosing divs. But this seems kind
of ugly. Is there a better way?
Perhaps I haven't understood what you're doing, but why not put the
background image on the common parent of stuff and more, and give stuff
and more either transparent background or left margins (instead of
padding) or both?
Feb 4 '07 #3
Ben C <sp******@spam.eggswrote:
>I thought Spartanicus had a good page about vertical centering, but I
couldn't find it.
Lauri Raittila http://www.student.oulu.fi/~laurirai/www/css/middle/

--
Spartanicus
Feb 4 '07 #4
On 2007-02-04, Spartanicus <in*****@invalid.invalidwrote:
Ben C <sp******@spam.eggswrote:
>>I thought Spartanicus had a good page about vertical centering, but I
couldn't find it.

Lauri Raittila http://www.student.oulu.fi/~laurirai/www/css/middle/
Thanks, that was the page I was thinking of.
Feb 4 '07 #5

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

Similar topics

4
1825
by: Matt Stanley | last post by:
I am trying to build a page that scales to fit the browser window regardless of size or resolution. The navigation on the top of the page is framed in dark red/brown using CSS with a background...
47
9077
by: Neal | last post by:
Patrick Griffiths weighs in on the CSS vs table layout debate in his blog entry "Tables my ass" - http://www.htmldog.com/ptg/archives/000049.php . A quite good article.
2
1113
by: Jim H | last post by:
Is there a Wizard class or interfaces available? I need to create a wizard for a feature in my app and I want the standard look and feel of a wizard. You know? Like the placement of the buttons...
36
2999
by: sonnystarks | last post by:
I am trying to learn HTML and have obtained several books on the subject. However, I am confused with the proper way of going about it as most of these books give me the basic tags and then say...
1
2421
by: dlogan | last post by:
Since this is becoming a complete hack-job, I think its about time I asked for some help. I am trying to make a calendar using AJAX to allow for the main calendar to display, then load in the events...
1
3087
by: cnixuser | last post by:
Hello, I am currently attempting to implement a simple actionlistener for a button in a JFrame that was created via "drag and drop" with the Netbeans 5.0 IDE, the code that I am using to implement...
2
2286
by: Francesco | last post by:
Hi there! I'm trying to organize my sources into a webroot tree like this, webroot index.htm - only contains index.php into a frame index.php - require_once('inc/layout.php') ...
2
4120
by: sriniwas | last post by:
Hi Frnd's, m using prefuse visulation,it's have one display class and this class have one saveImage(outPutStream, String jpg,double size);. now graph is converting ia jpg image properly.now my...
3
1125
by: Andy B | last post by:
I am creating a CSS layout and need to test it with different browsers. I have the framework for the layout done with contrasting colors for each section. Can anybody if possible, go to...
3
3780
tpgames
by: tpgames | last post by:
I'm looking for a program or command line or anything that would allow me to have more than the maximum 4 keyboard layout language groups that keyboard preferences in Ubuntu restricts me too. I can...
0
7201
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7278
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
7328
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...
1
6988
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
7456
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5578
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,...
1
5011
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...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
379
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...

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.