473,770 Members | 6,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CSS layout problem: Shouldn't this be a simple thing?

I've decided I need to rebuild my website from scratch to work properly
accross browsers (the previous version of the site worked fine in IE6, but
was really wonky in other browsers).

What I'm trying for is a simple layout with a header and two colums (left
and right) positioned immediately below it.

Here's what I've got so far:
http://www.captainsoftheworld.com/mo...test/index.php
http://www.captainsoftheworld.com/mo...rnRepublic.css

As often is the case I suppose, it works perfectly fine in IE. However, I
understand that IE is the worst at properly interpreting CSS; the page looks
quite wrong in Firefox and Mozilla (oh, and the tacky colours are purely for
testing purposes).

Could someone offer a suggestion regarding what I'm doing wrong? I've kept
the HTML and CSS code quite bare to make it easy to look at, I hope.

Thanks very much!

~Geoff
Jul 20 '05 #1
4 1748
Els
Geoff Hague wrote:
What I'm trying for is a simple layout with a header and
two colums (left and right) positioned immediately below
it.

Here's what I've got so far:
http://www.captainsoftheworld.com/mo...lic/test/index. php http://www.captainsoftheworld.com/mo...ic/test/Modern Republic.css
As often is the case I suppose, it works perfectly fine in
IE.
Because IE has a broken box-model.
However, I understand that IE is the worst at properly
interpreting CSS; the page looks quite wrong in Firefox and
Mozilla (oh, and the tacky colours are purely for testing
purposes).

Could someone offer a suggestion regarding what I'm doing
wrong? I've kept the HTML and CSS code quite bare to make
it easy to look at, I hope.


The problem is that the floats, by their nature, don't
actually use up any space, they're taking out of the normal
flow, just like absolute positioned elements.
This results in the div#SiteBody not being extended to hold
the two floated columns.
The solution to this, is to add a div with the clear:both
property, after the floats, but inside the div#SiteBody.
See my example:
http://locusmeus.com/temp/geoff.html
(with the css inside the file for easy checking)

More info on the subject, floats
http://www.w3.org/TR/CSS21/visuren.html#floats
and the clear property
http://www.w3.org/TR/CSS21/visuren.html#propdef-clear

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Melissa Etheridge - Bring Me Some Water
Jul 20 '05 #2
Els
Els wrote:
The problem is that the floats, by their nature, don't
actually use up any space, they're taking out of the normal ^^^^^^
taken
flow, just like absolute positioned elements.


--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
Now playing: Michael Jackson - Dirty Diana
Jul 20 '05 #3
"Els" <el*********@ti scali.nl> wrote in message
news:Xn******** *********@130.1 33.1.4...
The problem is that the floats, by their nature, don't
actually use up any space, they're taking out of the normal
flow, just like absolute positioned elements.
This results in the div#SiteBody not being extended to hold
the two floated columns.
The solution to this, is to add a div with the clear:both
property, after the floats, but inside the div#SiteBody.
See my example:
http://locusmeus.com/temp/geoff.html
(with the css inside the file for easy checking)


Perfect! Thank you very much!

~Geoff
Jul 20 '05 #5

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

Similar topics

82
10717
by: Peter Diedrich | last post by:
The site design is pretty simple: ============================================ | Head | ============================================ | | | | | | | | | left | center | right | | | | | | | | |
47
9158
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.
1
1510
by: Robert Latest | last post by:
OK, I'm trying to make a simple web page. I know that one shouldn't expect too much of browsers in terms of layout, but this is a simple task and I don't even know where to start. Point your browser to: http://www.stoptrick.com/new/ and find a directory listing. Look at layout_start.png in that directory, which is what my colleagues think the web site should look like. Pretty much the only important thing is that the contents of the...
14
4863
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the designer. The other could be that you have more free hand and control to design your GUI. 2....
8
2181
by: sethp | last post by:
I have a question about table layout in IE. I have a table with two columns. The left column has two rows and the right column has 1 row that has a column span of 2. In the left column I have given the top row a height of 20 pixels. In firefox, that row always stays 20 pixels high. The bottom row in the left column and the right column expand if you add more text to either the bottom left row or the right column. This does not work in...
26
2596
by: mark | last post by:
The idea of this is very simle. The site is 800px wide and sits in the middle of the browser window, on either side of the site I want a different background image aligned against it. If I were doing this with table based layout the code would be as follows: <head> <style type="text/css"> #bgleft { background: url(left_half_circle.gif) right top repeat-y;
3
3534
by: Rich.Hephner | last post by:
Hi, I'm new to this group, but in need of some help with a css based two column layout. The layout consists of a short left nav and a content section. The problem is that in IE, the content is shifted approx. 2 pixels to the right where the left nav floats next to it. This shouldn't be and isn't in FF.
5
1630
by: Ed Sproull [MSFT] | last post by:
First I'm pretty new to ASP.NET and I'm having a simple problem. I have small website with a header, sidebar and the the content. I want my content to appear beside my sidebar which seems to be a pretty standard layout. However when ever I resize my browser the content resizes below the sidebar. I've been digging through example websites can't seem to stop this behaviour. I had one person suggest Tables but I see a few posts that say...
15
2426
by: Eric Lindsay | last post by:
I need to include some simple (sparkline style) graphs in a web page that will have a liquid layout. Some viewers will be changing the font size to suit their display (sizes range from 320 to 2560 pixels). I want the graphs to change size proportional to the font enlargement viewers use. I did this sort of thing once before at http://cyclonestudios.com.au/aboutus/projects.html where the little colour patches under each project show...
0
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10053
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10001
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7415
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.