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

MSIE spacing woes and DIV width & height minimums

S
Whew!

Thanks for your help on that last post. I actually understand what you
wrote. I'm trying not to use these groups as a way to get my code written
for me, I really want to understand what I'm doing wrong (and right!) so
your explanations have been very helpful. I really appreciate them.

My last problems involve DIV sizing and MSIE Win spacing issues.

I have several DIVs on my page that need to be a minimum width and height.
My body DIV needs to be a minimum width so that the browser window resizing
does not eliminate it when the user resizes it to be to narrow. I also need
a minimum height for my nav DIV so that the background image shows up
without having to fill it with <br> tags.

Is there a way to set a minimum width and/or height for a DIV?

Also, my page looks (more or less) fine in Firefox Mac/Win, and Safari.
MSIE 6 Windows places a lot of extra space between the breadcrumb bar and
the nav. I don't understand why. I'm pretty sure my CSS is not allowing for
this, but it appears anyway.

http://www.dorseygraphics.com/review.../pagetemplate/

http://www.dorseygraphics.com/review...getemplate/css
/styles.css

Is MSIE just the worst browser to code for? Or is everyone else doing
something wrong? It seems that MSIE adds space and other crap like that to
every page I code! Why would they do things differently?

Thanks,

-----------------S

Oct 25 '05 #1
5 1886
S <ju*******@gmail.com> wrote:
Is there a way to set a minimum width and/or height for a DIV?


Duh: min-height:350px

min-height is not supported by IE, to get around that you could use IEs
broken overflow behaviour by specifying a fixed height "height:350px",
IE will expand that as needed. You then set the height back to "auto"
for proper browsers and hide that rule from IE using your preferred
"hide CSS from IE" method.

--
Spartanicus
Oct 25 '05 #2
yb
There are 'min-width', 'max-width', but they don't work at all on IE,
including IE6. They should in most other browsers, except Safari also
breaks when the item with min-width/max-width is positioned. I'm not
sure about min-height and max-height, I've never used them.

See : http://www.svendtofte.com/code/max_width_in_ie/

The solution should work for IE. However, the CSS will not validate,
although that shouldn't cause any usability problem since CSS parser
(other than IE here) will ignore what it doesn't understand.

I didn't use the solution myself since I also needed it to work in
Safari, with a positioned item. I used the window.onresize event
handler in Safari to detect the width and set it dynamically. Since I
wrote it for Safari, I used it in IE as well, with some minor changes.

I can post / send the code as a starting point, but be warned that its
not trivial, and there may be better solutions that don't require
javascript and browser detection. I recall that someone had a CSS only
workaround, might be better to google search on min-width min-height
workarounds and see whats available before opting for javascript
solution. I used it since my users were guaranteed to have javascript
browser and I didn't have to introduce any extra html or css.

Oct 25 '05 #3
yb wrote:

there may be better solutions that don't require
javascript and browser detection. I recall that someone had a CSS only
workaround, might be better to google search on min-width min-height
workarounds and see whats available before opting for javascript
solution.


http://www.mezzoblue.com/archives/20.../minheight_fi/

--
Gus
Oct 26 '05 #4
On 25 Oct 2005 08:18:49 -0700, "yb" <ba*********@yahoo.ca> wrote:
There are 'min-width', 'max-width', but they don't work at all on IE,
including IE6. They should in most other browsers, except Safari also
breaks when the item with min-width/max-width is positioned. I'm not
sure about min-height and max-height, I've never used them.

See : http://www.svendtofte.com/code/max_width_in_ie/

The solution should work for IE. However, the CSS will not validate,
although that shouldn't cause any usability problem since CSS parser
(other than IE here) will ignore what it doesn't understand.


You can slightly improve on that by putting the IE pseudo-CSS in a
separate file and including it within an IE conditional comment.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Oct 26 '05 #5
S
That's pretty much ow I solved the problem.

<style type="text/css" media="screen">
<!--
@import "css/styles.css";
-->
</style>

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="css/styles-ie.css" />
<![endif]-->

This refers MSIE Win to a separate CSS doc. Solves the problem, if only in a
dirty way.

Thanks,

----------------S
On 10/26/05 11:18 AM, in article 7t********************************@4ax.com,
"Stephen Poley" <sb******************@xs4all.nl> wrote:
On 25 Oct 2005 08:18:49 -0700, "yb" <ba*********@yahoo.ca> wrote:
There are 'min-width', 'max-width', but they don't work at all on IE,
including IE6. They should in most other browsers, except Safari also
breaks when the item with min-width/max-width is positioned. I'm not
sure about min-height and max-height, I've never used them.

See : http://www.svendtofte.com/code/max_width_in_ie/

The solution should work for IE. However, the CSS will not validate,
although that shouldn't cause any usability problem since CSS parser
(other than IE here) will ignore what it doesn't understand.


You can slightly improve on that by putting the IE pseudo-CSS in a
separate file and including it within an IE conditional comment.


Oct 26 '05 #6

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

Similar topics

4
by: Wenslauw | last post by:
A weird thing is going on. I don't understand it. I made a table: <TABLE border=0 cellpadding=0 cellspacing=0> <TR> <TD><A href="something"><IMG src="Welkom.gif" width="51"...
2
by: Phil K | last post by:
I'm trying to format a table where each row will contain a single line of text followed by a number of optional icon images (sometimes none). However, I'm having great difficulty in getting an even...
4
by: Bernd Goldschmidt | last post by:
Hi. I've got a somewhat wired problems with an extra space between table rows in Mozilla and Opera (IE works fine). With the code below, cells within a row align seamlessly, but there is a...
2
by: Bernd Nies | last post by:
Hi, Does somebody have an idea why MSIE 6 on this page http://www.nies.ch/switzerland/fauna/index.de.php/2 does not show the "New" icon in the lower right corner of the thumbnail like in...
3
by: JBH | last post by:
I'm having difficulty removing spacing between two rows in a table. Below is a copy of my source code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>About...
24
by: JB | last post by:
Hi All, This is doing my head in! Please help. I've built a simple <ul> to serve as a menu for a page I'm working on. I have tested the menu in Mozilla Fireworks 1.5 and it's fine - nice and...
19
by: pamelafluente | last post by:
Hi Guys, I am trying to include my little script in my html report. I have done an external JS file which contains it. If you remember, you have helped me to detect if the asp page was present...
1
by: replyrpatil | last post by:
What I am trying to do: I need to print a compact access report (font 6 size) created using RTF2 program developed by Stephen Lebans to generate a TIF image of custom size (5.5 in x 2.0 in) ...
9
by: derker | last post by:
hi, i am going crazy trying to figure this out. it seems like it should be real easy and probably is, but im kind of a nube flying by night so any thoughts or suggestions would be greatly...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.