473,414 Members | 1,776 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,414 software developers and data experts.

CSS Positioning divs wrt unrelated divs in IE


Hi. I'm new at CSS, so maybe this is obvious, but I've
looked around quite a bit looking for a solution.

I'm playing with the vertical positioning of elements in a 2-column layout.
The prototype "scaffolding" page I'm playing with is here:

http://www.eecs.berkeley.edu/~pasztor/test.html

It looks right in "Mozilla Firefox", but not in IE 6. In IE 6, the three
"nav" blocks are rendered right after one another in a vertical column.

Instead, I'd like the "nav" blocks in the right column to render
near the content to which they relate. So the "nav 4"
block should be right across from the "content 4" block. That is,
there should be white space between "nav 1" and "nav 4", enough to bring
"nav 4" down to where "content 4" is.

These blocks are floats -- the left ones are "float:left; clear:left;"
and the right ones are "float:right; clear:right;". (So maybe IE's doing
it right and Firefox is the one with the bug? .. in Firefox the "nav 4"
block is right where I want it to be.)

But anyway, can anyone tell me how to align divs in one column with
divs in another? Thanks!

--Egon
PS -- (I tried using "position:absolute" divs instead of floats
for my "nav" blocks .. but those could overlap if the "nav" content is too
long. I'd like the "nav" blocks never to overlap, if possible..)




Jul 20 '05 #1
2 3024
Egon Pasztor wrote:
Hi. I'm new at CSS, so maybe this is obvious, but I've
looked around quite a bit looking for a solution.

I'm playing with the vertical positioning of elements in a 2-column layout.
The prototype "scaffolding" page I'm playing with is here:

http://www.eecs.berkeley.edu/~pasztor/test.html

It looks right in "Mozilla Firefox", but not in IE 6. In IE 6, the three
"nav" blocks are rendered right after one another in a vertical column.

I have not tried this in IE 6. It seems to me that it might work to
insert something like this:
div.spacer {
clear: both;
line-height: 0; height: 0;
border: none;
margin-left: 0;
margin-top: 0;
margin-right: 0;
margin-bottom: 0;
}

and

<div class="spacer">&nbsp;</div>

before content4.

It may even work to use "clear: both;" instead of left or right.

I hope this is helpful.

John Moyer
http://www.rsok.com~jrm/
Jul 20 '05 #2

Thanks .. I've played with spacer divs and "clear; both" divs
for quite a while since my first post, and you're right,
they do the trick -- almost. However, I'm still stuck with
random 3-px width errors in IE/Win.

My new test page is here:

http://www.eecs.berkeley.edu/~pasztor/test2.html

and as you can see I've gotten the hang of aligning the divs in
both columns where I want them. The alignment is perfect in
Mozilla/Firefox.

But in IE/Win, the right edges of the divs are randomly
jittered by a few pixels -- the middle yellow box is wider
than the top and bottom yellow boxes; some of the turquoise
boxes are wider than others, and the entire frame is a few
pixels wider than my "width" style demands.

So I've found myself hunting through the "CSS hacks"
pages looking for a way to give one style command to IE
and a different set to other browsers. But I'm not happy with
this approach, because I only have IE/Win and Firefox here --
and who knows what problems IE/Mac or Opera or Konqueror
would have with any "hacks" I insert -- not to mention future
versions of these browsers.

I keep reading all these "horror stories" of designers discovering
that a hack to fix a bug in one browser breaks other browsers;
and I don't have all the browsers here to check!

Would this be easier with tables?
It seems it would be easier with tables...
"John Moyer" <jr*****@swbell.net> wrote in message
news:40************@swbell.net...
Egon Pasztor wrote:
Hi. I'm new at CSS, so maybe this is obvious, but I've
looked around quite a bit looking for a solution.

I'm playing with the vertical positioning of elements in a 2-column layout. The prototype "scaffolding" page I'm playing with is here:

http://www.eecs.berkeley.edu/~pasztor/test.html

It looks right in "Mozilla Firefox", but not in IE 6. In IE 6, the three "nav" blocks are rendered right after one another in a vertical column.

I have not tried this in IE 6. It seems to me that it might work to
insert something like this:
div.spacer {
clear: both;
line-height: 0; height: 0;
border: none;
margin-left: 0;
margin-top: 0;
margin-right: 0;
margin-bottom: 0;
}

and

<div class="spacer">&nbsp;</div>

before content4.

It may even work to use "clear: both;" instead of left or right.

I hope this is helpful.

John Moyer
http://www.rsok.com~jrm/

Jul 20 '05 #3

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

Similar topics

6
by: John Topley | last post by:
Hi, I'm trying to create a pure CSS layout using DIVs. I have three DIVs (in one column) down the left hand side of my page, with a ten pixel vertical gap between each of them (the content is on...
4
by: Jane Withnolastname | last post by:
I am trying to re-work an old site by replacing the html with css. On the main page, I have a logo image which I needed centred on the initial screen. I found the solution here:...
2
by: Pamel | last post by:
To start off, I am trying to get a page to do this with divs. http://commo.de/lotsadivs.png There is a navigation bar at the top. Then there is a big DIV that contains three other DIVs that...
1
by: David Ehmer | last post by:
Within divs my pages are rendering with the 2nd and subsequent elements indented slightly. eg the first paragraph, list item or heading is where it should be, all the rest in the div (whether...
9
by: Frances Del Rio | last post by:
I have a pg with lots of divs, one of them is a gray bar about 150px down from the top and 20px from the left... this bar (an image) is 767px wide and 1px high.. however, even though all divs are...
7
by: theo | last post by:
Please, Why is this wide 6px border showing up where it is. It's supposed to be at the bottom of the page, inside of base div. I'm positioning wrong, something needs to cleared or x-index...
17
by: George Hester | last post by:
http://tinyurl.com/5uj6w The lower middle icon the "block" should not drop down when the mouse is over it. How can I stop that? Also the navigation divs both top and bottom should follow the...
4
by: TheCeej | last post by:
I'm sorry to post what is ultimately a myspace problem, but I'm sure I'd still be having this problem with any html/css document, so the answer would more than likely be able to help anyone out. I'm...
2
by: nonsensitor | last post by:
I'm just learning xhtml & css, primarily from westciv's online tutorials and css guide. I've run into a couple of problems with a page I'm developing that I can't figure out. The first problem is...
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
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
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...
0
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...

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.