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

Mozilla; floats and width - bug?

Hi, on the following page,
http://stian.freeshell.org/index.php
the floated image in the latest post is shown as tiny/zero-width in
Mozilla 1.7 and Firefox 1.0 (you can just about make it left of the
text), while Opera 8 and MSIE shows it like intended, i.e. using the full
width of the picture.

The CSS is here - http://stian.freeshell.org/default.css

I just started using floated images in my posts, and I had not noticed it
before I tested with Mozilla. I've put the most relevant part of the code
below, although this is possibly caused by some cascading fault from
parent classes (or a bug in Mozilla)?

..imgfloat {
max-width: 100% !important; /* doesn't work? */
text-align: center;
margin: 0.25em;
}

..imgfloat p {
width: 200px; /* for caption wrapping */
font-style: italic;
font-size: 90%;
margin: 0 !important;
}

..picleft {
float: left;
margin-right: 1em;
}

..picright {
float: right;
margin-left: 1em;
}

It also displays correctly if I add the caption paragraph underneath the
image, like in the post directly below. It does not matter if the float
is left or right apparently.

My CSS has become very complicated and interleaved lately (time for a
cleanup), so I have a hard time finding the cause of this through the
different classes, but while testing I found that the problem disappeard
if I remove the width attribute of the 'imgfloat p' class, but this is
not acceptable as it stops any caption text from wrapping correctly ...
:/

Could any CSS-gurus have a look at this and maybe point me in the right
direction to fix this? Is Mozilla to blame or is it my code which is just
too messy? :)

best regards,
Stian Lund
Jul 21 '05 #1
2 2251
Stian Lund <st***************@operamail.com> wrote:
http://stian.freeshell.org/index.php
the floated image in the latest post is shown as tiny/zero-width in
Mozilla 1.7 and Firefox 1.0 (you can just about make it left of the
text), while Opera 8 and MSIE shows it like intended, i.e. using the full
width of the picture.

The CSS is here - http://stian.freeshell.org/default.css


The cause of the problem:

body img {
border: 0;
max-width: 100% !important;
}

You are using max-width inappropriately.

Next time instead of dumping a complete design onto the group make some
effort to find the issue yourself, if you can't then at least minimise
the code: http://www.spartanicus.utvinternet.i...s_help_you.htm

--
Spartanicus
Jul 21 '05 #2
Spartanicus <me@privacy.net> wrote in
news:4k********************************@news.spart anicus.utvinternet.ie:
body img {
border: 0;
max-width: 100% !important;
}

You are using max-width inappropriately.
Thanks a lot, that fixed it - I have NO idea what I thought when I placed
that there in the first place though. Not really sure *why* that caused
the result though, but maybe someone would care to enlighten me? :)

I just read that width should be explicitly defined for floats, so I'll
try redesigning it to use a fixed width for the image, that way the
caption can inherith the width of the parent element. It might be a
better way of doing this, although all images would then be scaled to the
static size.
Next time instead of dumping a complete design onto the group make
some effort to find the issue yourself, if you can't then at least
minimise the code:


Yes, sorry about that, I was a bit frustrated after not finding the
problem after a couple of hours messing with it. I was in the process of
making a minimized test page, but was not able to reproduce the error. No
wonder... :P

Thanks for the help,
Stian
Jul 21 '05 #3

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

Similar topics

10
by: Anders Wegge Jakobsen | last post by:
Hi, I'm playing around with a layout for a weblog. A mockup can be seen at <http://outside.bakkelygaard.dk/~wegge/testblog/index.html>. The page has a fixed width of 800px, so I'm perfectly...
2
by: Dariusz | last post by:
I am trying out a fully CSS-P layout (first time with floats) and am having problems with getting certain DIV's from displaying properly - or rather - they are being completely ignored. Below is...
2
by: Robert William Vesterman | last post by:
I'm having problems with the display of forms, using CSS, in Mozilla Firebird (and probably other Mozilla-based browsers). I have boiled it down to a fairly small example page, which not only...
21
by: Applebrownbetty | last post by:
Hi, I've run into a problem with IE 6 vs. Mozilla when displaying a completely CSS positioned page, and was wondering if any resident CSS guru might quickly be able to find the problem(s). Thank...
3
by: Günther Stößl | last post by:
Hello I am trying to position two floats inside a table column. <td> <div style="position:relative; width:100%"> <div style="position:absolute; left:0px; width:60%>... </div> <div...
1
by: donpro | last post by:
https://testbed.odysseyshipping.com/index.php This is driving me nuts. I've spent much time trying to style this page footer but because I cannot set widths using "display: inline". I've tried...
5
by: Amir Michail | last post by:
Hi, I would like to center a logo between left and right floats with different widths. The issue is that the logo should be centered with respect to the window, not the area between the left...
7
by: randaldesign | last post by:
I can't show you the markup because the project is still under-wraps, but I've got a situation where floats behave as expected in all the browsers except FireFox. (Safari, IE) In some instances,...
6
by: Hendrik Maryns | last post by:
Hi, There is a little problem with the header on the page I recently converted from frames to proper HTML+CSS. The top part with the navigation used to be the top frame but is now included via...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...

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.