473,666 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fluid layout breaks in IE

I have part of my website that has to be laid out with 3 DIVs like
this:

|---------------------------------------------------------||--------------------|
| ||
|
|---------------------------------------------------------||
|
| ||
|
|---------------------------------------------------------||--------------------|

here is the html:

<div id="Logo"></div>
<div id="Menu">...</div>
<div id="heading">.. ...</div>

here is the css:
#Main{
#Logo{
width: 100px;
height: 65px;
float: right;
background: #30304A url('Images/logoarea.jpg') bottom left no-repeat;
}
#Menu{
height: 30px;
background: #30304A url('Images/nav_bg.jpg') top left repeat-x;
white-space: nowrap;
margin-right: 100px;
}
#Heading{
height: 35px;
background: #8F93C3 url('Images/heading_bg.jpg' ) repeat-x;
padding-left: 13px;
margin-right: 100px;
}
}

My problem is that in IE there is a gap(approx 2px) between "Logo" and
the other two DIVs.

How can I fix this?

Jul 18 '06 #1
6 1525
hiazle wrote:
I have part of my website that has to be laid out with 3 DIVs like
this:

|---------------------------------------------------------||--------------------|
| ||
|
|---------------------------------------------------------||
|
| ||
|
|---------------------------------------------------------||--------------------|
Maybe you can see that your "diagram" is not so useful. Did you use tabs
at the end of some lines?
here is the html:
An actual URL would have been better than pasting some fake HTML and
fake CSS.
>
<div id="Logo"></div>
<div id="Menu">...</div>
<div id="heading">.. ...</div>

here is the css:
#Main{
#Logo{
width: 100px;
height: 65px;
float: right;
background: #30304A url('Images/logoarea.jpg') bottom left no-repeat;
}
#Menu{
height: 30px;
background: #30304A url('Images/nav_bg.jpg') top left repeat-x;
white-space: nowrap;
margin-right: 100px;
}
#Heading{
height: 35px;
background: #8F93C3 url('Images/heading_bg.jpg' ) repeat-x;
padding-left: 13px;
margin-right: 100px;
}
}
CSS does not nest like this. I think you're lucky that anything comes
out of your browser at all (assuming it does, but without an URL, I
can't really tell).

CSS is case sensitive, so "heading" is not the same as "Heading".

Next time, try validating your page first, before posting. Then provide
an URL.

--
John
Jul 19 '06 #2
John Hosking wrote:
CSS is case sensitive, so "heading" is not the same as "Heading".
^^^^^^^^^^^^^^^ ^^^^^^

In general, this is wrong.

<blockquote cite="http://www.w3.org/TR/REC-CSS2/syndata.html#q4 ">
All CSS style sheets are case-insensitive, except for parts that are not
under the control of CSS. For example, the case-sensitivity of values of
the HTML attributes "id" and "class", of font names, and of URIs lies
outside the scope of this specification. Note in particular that element
names are case-insensitive in HTML, but case-sensitive in XML.
</blockquote>

The same says <http://www.w3.org/TR/CSS21/syndata.html#q6 >.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 19 '06 #3
Johannes Koch wrote:
John Hosking wrote:
>CSS is case sensitive, so "heading" is not the same as "Heading".

^^^^^^^^^^^^^^^ ^^^^^^

In general, this is wrong.
The same says <http://www.w3.org/TR/CSS21/syndata.html#q6 >.
Hmm, that what the W3C says, all right. I had not read that before. Now
I've read it, but maybe not understood it completely.

What I get now is, CSS itself (the stylesheet) is not case sensitive
(nor is HTML itself), but as soon as I try to *connect* one with the
other, I have to pay attention to case.

This matches my experience, where my HTML includes <span class="Blurb">,
and all my tweaking to .blurb {color:#0000FF; } fails to change the
color, until I notice the differences in capitalization.

So CSS *isn't* case sensitive, until I try to use it...
Jul 19 '06 #4
John Hosking wrote:
>
Maybe you can see that your "diagram" is not so useful. Did you use tabs
at the end of some lines?
Next time, try validating your page first, before posting. Then provide
an URL.
Ok, I made a mistake on the HTML and CSS that I provided but you really
have to burn me for it? Unfortunately I do not have a url to provide at
that moment so I have to improvise in order to give you a visual of
what I'm trying to accomplish

The diagram was meant to look like this:

|-----------------------------------||--------------------|
| || |
|-----------------------------------|| |
| || |
|-----------------------------------||--------------------|

And the html was supposed to look like this:

<div id="main">
<div id="logo"></div>
<div id="menu">...</div>
<div id="heading">.. ...</div>
</div>

And the CSS:

#main{
margin: 0;
padding: 0;
}
#logo{
width: 100px;
height: 65px;
float: right;
background: #30304A url('Images/logoarea.jpg') bottom left no-repeat;
}
#menu{
height: 30px;
background: #30304A url('Images/nav_bg.jpg') top left repeat-x;
white-space: nowrap;
margin-right: 100px;
}
#heading{
height: 35px;
background: #8F93C3 url('Images/heading_bg.jpg' ) repeat-x;
padding-left: 13px;
margin-right: 100px;
}
Basically, what I'm trying to achieve here is to have two divs on the
left and one on the right (The same effect you get when you do
rowspan="2" in a table). In the end, the total height of the two divs
on the left equals the height of the div on the right.

All this works fine in Firefox and Opera, but in IE there is a white
space between the two divs on the left and the one on the right

Jul 26 '06 #5
hiazle wrote:
Ok, I made a mistake on the HTML and CSS that I provided but you really
have to burn me for it?
Sorry, but I didn't mean to "burn" you; I was just pointing out a
problem. It was hindering my understanding of this problem (and could
get in the way for other people and in other posts you might make in the
future). I tried to phrase it as best I could. (I also wasn't sure if
your diagram looked hunky-dory in your newsreader; maybe everything
looked fine yo you, even in my reply. At least I'm not crazy. ;-)
Unfortunately I do not have a url to provide at
that moment so I have to improvise in order to give you a visual of
what I'm trying to accomplish

The diagram was meant to look like this:

|-----------------------------------||--------------------|
| || |
|-----------------------------------|| |
| || |
|-----------------------------------||--------------------|
Yay! Much better.
And the html was supposed to look like this:
<snipped; see below>
>
And the CSS:
<snipped; see below>
>
All this works fine in Firefox and Opera, but in IE there is a white
space between the two divs on the left and the one on the right
Well, I don't know the answer to your problem, but I spent some time
looking at it, and maybe somebody else (or you!) can figure it out from
here.

First, I've taken your HTML and CSS and posted it on a server to which I
have access: http://www.zugerfechtclub.ch/MM/Junk/hiazle.htm

Second, I modified your styles to provide contrasting (ugly) colors and
some visible texts. Doesn't change your problem at all. This gives your
"white space" an ugly orangey color; the space is from div#main.

Third, I added a second (tweaked) instance of your code, separated from
your otherwise unchanged code by a clear and some <HR>s.

I see by trial and error that your backgrounds, margin-rights, and
padding-left are all irrelevant to your problem. If this had been *my*
problem I was posting, I would have left all that stuff out.

What does seem to make a difference, although it doesn't solve your
problem, is removing the heights for the two left-hand DIVs (menu and
heading). For some reason I don't know, this eliminates the space in IE.
Of course, then your DIVs are the wrong size...

I had rather suspected the 3-pixel jog, but as I tried to understand the
explanation at
<http://www.positionise verything.net/explorer/threepxtest.htm land
played with the code, I came to think it must be something else. But
maybe somebody else here knows.

--
John
Jul 28 '06 #6

John Hosking wrote:
>
What does seem to make a difference, although it doesn't solve your
problem, is removing the heights for the two left-hand DIVs (menu and
heading). For some reason I don't know, this eliminates the space in IE.
Of course, then your DIVs are the wrong size....

--
John
Thanks a lot John... I'll give that a try. If I really have to do away
with the heights, then I'll try specifying a height in a div inside.
hopefully that does the trick

Hiazle

Jul 30 '06 #7

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

Similar topics

5
1703
by: Alex Bell | last post by:
I have a fluid header/two column layout at http://www.members.iinet.net.au/~abell1/test/demo10.htm which works with windows MSIE 5.5 and 6, Mozilla, Netscape, and Opera; and Safari but which crashes with Mac MSIE 5. Rather than try to hack the demo to make it work with Mac MSIE 5 I'd like to find a fluid header/two column layout which will work with this browser, and see if I use alternate css files to make the eventual site work with...
47
9127
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.
22
3503
by: Jam Pa | last post by:
Once again my big mouth has landed me with a tough job. I have a static CSS layout, where each and every element has been defined by pixel size - lots of them, too! Mostly relative elements, though. Imagine centered column layout, with a header box, and content box with lots of smaller content boxes of different sizes, some spanning several 'rows' or 'columns'. How would you go about changing this kind of static layout into
7
3239
by: Alex | last post by:
Hi Everone, I need some advice on how to setup 4 columns where the outside two are absolute (120px) and the inner two (side by side) are relevent (Fluid) and change with the screen. Here's my rough layout:
12
2378
by: JB | last post by:
Hi All, Is it acceptable to use a fixed width vertical navigation column within a fluid 2 or 3 column layout? Example. Left Column (navigation) fixed width of say 180px Right Column (main content) fluid width to fit rest of window
2
3094
by: James Frayne | last post by:
Hi, I am trying to integrate phpBB into my existing site design. I am doing this simply by pasting fragments of my HTML into the phpBB templates. This works fine in Firefox and Opera but the layout breaks in IE. I have narrowed down the problem to the fact that phpBB uses tables for layout and sets the width of those to 100%. If I change this to 80% it looks correct in IE but not in Firefox. Is this a bug in IE and if so how can I...
9
3100
by: TristaSD | last post by:
Hi, How do I accomplish the following: In a two-column layout, the right column is 200px wide, and the left column is fluid? Thanks!
1
1938
by: lister | last post by:
Hi, I have a div with fluid content, below which I want a scrollable div. I can't work out how to style the scrollable div to say "use the rest of the space in the container". The best I can come up with is having the scrollable div abolutely positioned as in my demo, but this is horrible as it doesn't follow the fluid stuff.
18
2501
by: Nik Coughlin | last post by:
I am halfway through writing a tutorial on image slicing for fluid CSS layouts, I would love some feedback on what I've done up until this point: http://nrkn.com/index.html I am still writing parts 3 & 4, "optimising the layout" and "alpha transparency". Also, does anyone know why I don't get numbers or bullets on my ul and ol in Internet Explorer (6 or 7)?
3
3769
by: hzgt9b | last post by:
I want a page with a centered div containing two rows. Top row has an image and some text. The bottom row needs to have three columns. I'd love to have the 1st column set to a fixed width then have the 2nd and 3rd columns fill the remaining space but I've given up on that and am willing to settle for the second row to have a fluid 3-column layout (or something else simple). Anyway, I've developed a page where the second row has this 3...
0
8352
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
8863
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
8780
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
8549
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,...
0
7378
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
6189
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
4192
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
4358
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2765
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.