472,958 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 2239
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...

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.