473,729 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "scaffoldin g" 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:righ t; 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:absol ute" 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 3044
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 "scaffoldin g" 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 "scaffoldin g" 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
3847
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 the right). At the moment these DIVs are all using absolute positioning, with dimensions and co-ordinates specified in pixels. How can I make it so that if the user increases the font size the DIVs enlarge to accommodate the content but still...
4
2715
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: http://www.wpdfd.com/editorial/wpd0103.htm#toptip (the second example) The problem is, under the image is a large table. But using the above positioning, now the table starts at the top of the page and runs underneath the image.
2
1947
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 contain text and/or pictures. textdiv1 is dropped from the top maybe 50 pixels. All of the textdivs are centered and expand to fit the size of the page. textdiv1 and 2 are of arbitrary height, but textdiv3 is supposed to be right under whichever...
1
1659
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 they are img, h2, p, li etc) are indented a small amount. If you have IE5.2Mac see the link below for an example of this. Note these divs mostly aren't positioned. ie they just sit in the normal flow. Seems to be a problem specific to this...
9
1803
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 positioned consistently in IE and Netscape, in Netscape (7.1) the bar div ONLY is about 10px ABOVE where it should be.. code: HTML: <div id="bar"> <img src="images/bar.gif" width="768" height="1" border="0"> </div>
7
1859
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 specified, or something. HELP??? http://wholives.com/temp/cssr.htm Thanks,
17
3045
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 scroll right. Both of these issues occur in IE 6 but not in IE 5.5. You can get the horizontal scroll bar for the window by increasing the size of the image wider than the display area of the window. Assumes 600x800 default display size. Thanks...
4
7815
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 pretty sure I know what the problem is already. I just don't know how to fix it. I'd be very grateful of any help. I'll post what I'm trying to do, what keeps happening, what I believe the problem is, the link to my page and the css, and things...
2
3164
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 that I would like to display some text on top of an image within the header. I've tried using absolute positioning to specify where the phone number should appear in relation to the parent div (#header). However the text appears to be positioned in...
0
8917
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9426
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9281
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...
0
8148
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6722
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
6022
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
4525
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...
0
4795
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3238
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

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.