472,354 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 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 2979
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
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...

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.