473,394 Members | 2,063 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,394 software developers and data experts.

some layout problems in firefox and IE

Hi there,

simply.amandadevries.com/index.html

The page validates fine. Yes I know I'm using a table where I
shouldn't but I can't otherwise figure out how to get my little image
for the list items in the div headlines to line up with the
corresponding questions, and with a little space between. If you feel
like answering this, great! Otherwise, read on for the reason for my
post:

1. I want the 'nav' bar to go across the whole page, and for the nav
items to be centred. In Firefox it's floating somewhere in the middle,
but not quite, and not going 100% across. In IE, it's going all the
way across, but the text isn't centred.

I am using a friend's code to get the drop-down menus without
Javascript. So I didn't generate the nav CSS myself, although I've
tuned it for colours, widths, etc...

2. Now please click on "Services->Courses and Services". How do I get
my left col to be the exact same height as whatever my right col turns
out to be? On every page, the left column will have less content, but
I want it to have the same height anyway. I can't seem to get it to be
100% of the height of the container div which it's sitting in - why
not?

Thanks in advance!
Amanda

Jun 13 '07 #1
2 2937
On 2007-06-13, ottawamom <am*******@gmail.comwrote:
Hi there,

simply.amandadevries.com/index.html

The page validates fine. Yes I know I'm using a table where I
shouldn't but I can't otherwise figure out how to get my little image
for the list items in the div headlines to line up with the
corresponding questions, and with a little space between. If you feel
like answering this, great! Otherwise, read on for the reason for my
post:

1. I want the 'nav' bar to go across the whole page, and for the nav
items to be centred. In Firefox it's floating somewhere in the middle,
but not quite, and not going 100% across. In IE, it's going all the
way across, but the text isn't centred.
You're setting width: 100% and auto left and right margins on #nav. But
this can't work: if the width is 100% there aren't going to be any left
and right margins.

The menu items (HOME, SERVICES, etc) are themselves floats so they
always float to one side or another. They won't ever be centered in
their container.

So one solution is to provide a container to shrink-wrap the menu items
and then to centre that container. The only suitable containers with
shrink-to-fit behaviour are given by display: inline-block or display:
table, neither of which work in IE (and the former doesn't work in FF
either).

The alternative is to make the menu items display: inline and to set
text-align: center on their (full-width) container. This means making
everything inside them display: inline too (you've got display: block
set on anchor for example) rather than floating everything.

If you do make everything inline you won't be able to set widths on
things any more so each li will just have to be as wide as its contents.
But that might be OK since they don't have any borders or anything but
just sit on that blue background.
I am using a friend's code to get the drop-down menus without
Javascript. So I didn't generate the nav CSS myself, although I've
tuned it for colours, widths, etc...
I'd be tempted just to get used to the idea of it all being
left-aligned rather than centered.
2. Now please click on "Services->Courses and Services". How do I get
my left col to be the exact same height as whatever my right col turns
out to be? On every page, the left column will have less content, but
I want it to have the same height anyway. I can't seem to get it to be
100% of the height of the container div which it's sitting in - why
not?
There are some devious tricks out there to do this (called things like
"the holy grail") but they're too clever if you ask me and not necessary
in this case. The .container's height is given by the height of the
right col, so make .container position: relative (so it becomes the
containing block for .leftcol) and add to .leftcol:

position: absolute; top: 0; bottom: 0;

and remove from it the float and clear properties. Might as well get rid
of display:block too, since it's implied by position:absolute (or
float).

The reason height:100% doesn't work on the float is because its
container's height is auto. You can't do percentage heights of auto
height containers generally speaking since that's a bit of a circular
requirement.
Jun 13 '07 #2
Ben,

Thanks, your comments are always helpful without being condescending!
Much appreciated.

Amanda
On Jun 13, 5:26 pm, Ben C <spams...@spam.eggswrote:
On 2007-06-13, ottawamom <amanda...@gmail.comwrote:
Hi there,
simply.amandadevries.com/index.html
The page validates fine. Yes I know I'm using a table where I
shouldn't but I can't otherwise figure out how to get my little image
for the list items in the div headlines to line up with the
corresponding questions, and with a little space between. If you feel
like answering this, great! Otherwise, read on for the reason for my
post:
1. I want the 'nav' bar to go across the whole page, and for the nav
items to be centred. In Firefox it's floating somewhere in the middle,
but not quite, and not going 100% across. In IE, it's going all the
way across, but the text isn't centred.

You're setting width: 100% and auto left and right margins on #nav. But
this can't work: if the width is 100% there aren't going to be any left
and right margins.

The menu items (HOME, SERVICES, etc) are themselves floats so they
always float to one side or another. They won't ever be centered in
their container.

So one solution is to provide a container to shrink-wrap the menu items
and then to centre that container. The only suitable containers with
shrink-to-fit behaviour are given by display: inline-block or display:
table, neither of which work in IE (and the former doesn't work in FF
either).

The alternative is to make the menu items display: inline and to set
text-align: center on their (full-width) container. This means making
everything inside them display: inline too (you've got display: block
set on anchor for example) rather than floating everything.

If you do make everything inline you won't be able to set widths on
things any more so each li will just have to be as wide as its contents.
But that might be OK since they don't have any borders or anything but
just sit on that blue background.
I am using a friend's code to get the drop-down menus without
Javascript. So I didn't generate the nav CSS myself, although I've
tuned it for colours, widths, etc...

I'd be tempted just to get used to the idea of it all being
left-aligned rather than centered.
2. Now please click on "Services->Courses and Services". How do I get
my left col to be the exact same height as whatever my right col turns
out to be? On every page, the left column will have less content, but
I want it to have the same height anyway. I can't seem to get it to be
100% of the height of the container div which it's sitting in - why
not?

There are some devious tricks out there to do this (called things like
"the holy grail") but they're too clever if you ask me and not necessary
in this case. The .container's height is given by the height of the
right col, so make .container position: relative (so it becomes the
containing block for .leftcol) and add to .leftcol:

position: absolute; top: 0; bottom: 0;

and remove from it the float and clear properties. Might as well get rid
of display:block too, since it's implied by position:absolute (or
float).

The reason height:100% doesn't work on the float is because its
container's height is auto. You can't do percentage heights of auto
height containers generally speaking since that's a bit of a circular
requirement.

Jun 14 '07 #3

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

Similar topics

7
by: Matt Kruse | last post by:
This is a typical layout, but I have specific requirements. I'm trying to figure out a) if it's possible to meet the requirements and b) if so, how. +---------------+ | header |...
7
by: Xavier Onassis | last post by:
I would be grateful for recommendations for a CSS layout (header, 2 cols, footer) that can accomodate dynamically added elements. I am not having any luck so far getting this to work in...
3
by: Dave | last post by:
I am designing a web page using VS2003 ASP.NET. The page contains various DIVs (panels), one of which is in grid layout. The controls in this DIV render correctly in IE, but when using Firefox they...
11
by: Ben Holness | last post by:
Hi all, I am having some trouble with some table code. It works fine in Internet Explorer, but the layout doesn't work correctly in Firefox 1.0.7 Is this a firefox bug, or am I missing...
2
by: Edward | last post by:
I'm pursuing the holy grail of creating a two-column CSS layout with footer AND where the colors of the columns actually go all the way down. The code is below. Here is a graphic of how it...
11
by: Grischa Brockhaus | last post by:
Hi, I'm trying to produce a div layout containing a header on the top with fixed height, a footer on the bottom using fixed height and a content layer using what's left of the browsers window. ...
7
by: Daniel Kabs | last post by:
Hi there, for a long time I've been using tables to layout elements on a web page. Example: Say we have a 2x2 table and I'd like to put text (left aligned) and buttons (right aligned) in the...
7
by: Michael7 | last post by:
Hi Everyone, I created my website with extremely simple HTML coding. I aimed at having the website accessible to even really old browsers, to make it as accessible to everyone as possible, even...
7
by: amishguy | last post by:
Hello, I am having an issue with a site I'm creating right now. I have had this issue before and I would like to figure out what the solution is instead of using workarounds as I have in the...
7
by: lawpoop | last post by:
On Mar 11, 6:58 pm, Bergamot <berga...@visi.comwrote: Berg, thanks for taking the time to look at this. Here is the URL ( sorry for the delay in response): http://nerdcraft.net/survey.html ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.