473,683 Members | 3,702 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 3042
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
3844
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
2709
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
1945
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
1655
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
1858
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
3044
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
7812
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
3160
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
8568
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
8504
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
8922
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
8771
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5789
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
4299
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
2934
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
2195
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1921
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.