473,396 Members | 2,024 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.

Non-fixed width layout using CSS

I am attempting to convert some content layout on a site that I manage from
using a table to using CSS, but I cannot figure out how to do it.

The following HTML is a simplification of what I am trying to convert (you can
see the actual content layout on the home page of <http://www.NanimeW.Org.UK/>):
<table border="0" align="center">

<tr valign="bottom">

<td align="center">

<h1>Some content</h1>

<p>Some more<br />
content</p>

</td>

<td align="center">

<h2>Some content</h2>

<h3>Some more content</h3>

</td>

</tr>

</table>
Basically, it's two containers, side by side, horizontally centred in the
browser window. The containers are vertically aligned along the bottom edge.
The contents of both the containers are also horizontally centred. The widths
of the containers are not specified, as they should be determined by the amount
of space required to display their contents.

I've read a number of CSS layout tutorials, but they all seem to use containers
that have a width specified that is either a fixed amount or relative to the
parent container (e.g the width of the browser window). I don't want to have
to specify any widths (there would be no widths that would make any sense).

I've tried variations on the following, but there doesn't appear to be a way to
limit the width of the parent container to just be the width of its contents,
rather than the width of *its* parent (e.g. the window):
<body style="text-align: center;">

<div>

<div style="float: left;">
</div>

<div style="float: right;">
</div>

</div>

</body>
With a CSS layout solution, I would not mind if the right-hand container was
displayed below the left-hand one in cases where there is insufficient
horizontal space to display them side-by-side.

I would be grateful for any pointers.

[Happosai]
--
|\ | \ / /V\ Bringing together fans of Japanese
| \| a n i m e \/\/ =(@;@)= animation, graphic art and pop
~(,,) culture in the North-West of England
<http://www.NanimeW.Org.UK/> -=*=- <mailto:Info[at]NanimeW.Org.UK>
Jul 20 '05 #1
0 2086

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

Similar topics

12
by: lothar | last post by:
re: 4.2.1 Regular Expression Syntax http://docs.python.org/lib/re-syntax.html *?, +?, ?? Adding "?" after the qualifier makes it perform the match in non-greedy or minimal fashion; as few...
3
by: Mario | last post by:
Hello, I couldn't find a solution to the following problem (tried google and dejanews), maybe I'm using the wrong keywords? Is there a way to open a file (a linux fifo pipe actually) in...
25
by: Yves Glodt | last post by:
Hello, if I do this: for row in sqlsth: ________pkcolumns.append(row.strip()) ________etc without a prior:
32
by: Adrian Herscu | last post by:
Hi all, In which circumstances it is appropriate to declare methods as non-virtual? Thanx, Adrian.
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
14
by: Patrick Kowalzick | last post by:
Dear all, I have an existing piece of code with a struct with some PODs. struct A { int x; int y; };
11
by: ypjofficial | last post by:
Hello All, So far I have been reading that in case of a polymorphic class ( having at least one virtual function in it), the virtual function call get resolved at run time and during that the...
2
by: Ian825 | last post by:
I need help writing a function for a program that is based upon the various operations of a matrix and I keep getting a "non-aggregate type" error. My guess is that I need to dereference my...
399
by: =?UTF-8?B?Ik1hcnRpbiB2LiBMw7Z3aXMi?= | last post by:
PEP 1 specifies that PEP authors need to collect feedback from the community. As the author of PEP 3131, I'd like to encourage comments to the PEP included below, either here (comp.lang.python), or...
12
by: puzzlecracker | last post by:
is it even possible or/and there is a better alternative to accept input in a nonblocking manner?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
0
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...
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
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
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
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,...
0
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...

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.