473,396 Members | 1,783 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.

Aligning content vertically

Hi all,

I was curious as to how others whom have dealt with this problem have
handled it.

The problem is that I have a site design of a fixed width and height and
want to center that content in the middle of the browser's viewport,
both horizontally AND vertically.

The site I'm building requires that I adhere to the HTML 4.01
Transitional standard, so I can't just use quirks mode and use a table
with height=100% and width=100%. I've tried just about everything with
HTML and CSS but to no avail. I'm going to start exploring scripting
routes, but wanted to know if anyone has had any luck with vertically
centering their content on a page.

Any thoughts or suggestions are appreciated.

Thanks!

Scotty
Sep 9 '05 #1
7 1640
Scott Teglasi <st******@subpacket.com> wrote:
I was curious as to how others whom have dealt with this problem have
handled it.

The problem is that I have a site design of a fixed width and height and
want to center that content in the middle of the browser's viewport,
both horizontally AND vertically.


I avoid that problem by designing my site without a fixed width or height.

See also:
http://www.htmlhelp.com/faq/html/des...ml#screen-size
http://www.xs4all.nl/~sbpoley/webmat...lexdesign.html
http://westciv.com/style_master/hous...oil/not_paper/
--
Darin McGrew, mc****@stanfordalumni.org, http://www.rahul.net/mcgrew/
Web Design Group, da***@htmlhelp.com, http://www.HTMLHelp.com/

"What is the use of running when you are not on the right road?"
Sep 9 '05 #2
Scott Teglasi <st******@subpacket.com> wrote:
I was curious as to how others whom have dealt with this problem have
handled it.
What problem? (posting rule: repeat the subject in the body of the
message if it's relevant to understanding).

[copy and paste from subject]

Re: Aligning content vertically

That's a style issue, thus it should have been posted in
c.i.w.a.stylesheets
The problem is that I have a site design of a fixed width and height
Something to solve then.
The site I'm building requires that I adhere to the HTML 4.01
Transitional standard
Why on earths name use deprecated and horrible transitional coding
techniques? Transitional is for legacy documents that cannot be revised,
all revised or newly authored documents should be coded to the strict
model and use a strict doctype.
but wanted to know if anyone has had any luck with vertically
centering their content on a page.


See if this helps: http://www.student.oulu.fi/~laurirai/www/css/middle/

--
Spartanicus
Sep 9 '05 #3
Spartanicus wrote:
Scott Teglasi <st******@subpacket.com> wrote:
The site I'm building requires that I adhere to the HTML 4.01
Transitional standard

Why on earths name use deprecated and horrible transitional coding
techniques? Transitional is for legacy documents that cannot be revised,
all revised or newly authored documents should be coded to the strict
model and use a strict doctype.

I have a question:
What can you do in XHTML/HTML4.01 Strict that you can't do in HTML 4.01
Transitional?
I would expect that the answer is 'nothing'. 4.01 Transitional is
obviously more forgiving of techniques that are frowned upon (<font> for
instance), but that's not to say it's a waste of time.

Geoff
Sep 9 '05 #4
geoff_syndicate <mu****@mobsters.com> wrote:
Why on earths name use deprecated and horrible transitional coding
techniques? Transitional is for legacy documents that cannot be revised,
all revised or newly authored documents should be coded to the strict
model and use a strict doctype.

I have a question:
What can you do in XHTML/HTML4.01 Strict that you can't do in HTML 4.01
Transitional?


It's primarily about the coding method, the choice of doctype is
secondary. That said, it would be difficult to think of a good reason to
code to strict standards, but under a transitional doctype.

--
Spartanicus
Sep 9 '05 #5
geoff_syndicate wrote:
What can you do in XHTML/HTML4.01 Strict that you can't do in HTML 4.01
Transitional?


Have a validator tell you if you're using obviously-presentational markup.
Sep 9 '05 #6
geoff_syndicate wrote:

Why on earths name use deprecated and horrible transitional coding
techniques? Transitional is for legacy documents that cannot be revised,
all revised or newly authored documents should be coded to the strict
model and use a strict doctype.

I have a question:
What can you do in XHTML/HTML4.01 Strict that you can't do in HTML 4.01
Transitional?

Transitional allows coding to v4.01 while accepting a number of
deprecated elements and attributes. Strict does not, and encourages the
use of CSS to replace the functionality "lost" by the deprecated elements.
Which, in general, is a Good Thing.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Sep 9 '05 #7
On Thu, 8 Sep 2005, Scott Teglasi wrote:
The problem is that I have a site design of a fixed width and height


Indeed it would be. So don't do that.

Sep 10 '05 #8

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

Similar topics

16
by: C.W | last post by:
I have a top box element that houses the web site title: #top_section { height: 20px; padding: 10px; text-align: left; background: navy; color: white; }
2
by: Iain Hallam | last post by:
Hi. I've got a few divs on a page that are positioned as "fixed". I now want my text to centre itself both horizontally and vertically. "text-align: center" on the body works for horizontal, but...
2
by: Dave | last post by:
Hello all, I need to know if you can vertically align Items within an ItemTemplate. For example I have two columns, one column has a stack of 6 textboxes, my second column can have 1 to n...
3
by: Mark Wiewel | last post by:
hi all, i am a newbie in ASP.NET and i couldn't find the solution to this one: i have a form with three datagrids on it. i would like to align them vertically with a space between each grid of...
4
by: Greg Scharlemann | last post by:
I'm having difficulty getting the radio buttons to align vertically with one another and the header (1 2 3 4 5) at the top. Ideally each radio button will be directly below the one above it and...
3
by: iamconfused | last post by:
Hi All... I have a very simple question (atleast I hope it is). How can I make sure the table on my page always appears in the middle (vertically & horizontally)? I am using dreamweaver, it...
2
by: Casimir | last post by:
What would be the correct way to align checkboxes and their labels, in your opinion? For example .... <td> <input type="checkbox" class="cbox" name="thisCheck" /> <label...
7
by: Bram2 | last post by:
Sorry if this sounds like a dumbass newbie question. I'm getting crazy or something, but somehow I can't get this simple thing to work: 1. In general, how do I center text and/or images...
3
by: Bram2 | last post by:
When putting a form on a webpage, I prefer the labels and edit boxes for all fields to be aligned, e.g. like this: http://i44.tinypic.com/6dvceo.png This is easily done by putting it all in a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
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
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
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,...

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.