FREEDANCE: Il blog di Alessandro D’agnano

Libera la creatività

Archive for Agosto 2008

FireFox 3 bug – float:right

con 2 commenti

Hi All,
I found a strange behaviour of Firefox New Release.
Why does it happen and is it a bug?

Try to do this:
Markup, directly in the body, a div, like this:
<body>
<div id=”wrapper”></div>
</body>

Then associate it the following and simple Css line:

#wrapper {width:1000px; float:right; background:#CC66FF;}§
(obviously the width of the div is not important, choose one)

Let’s see what happens… if our resolution or our Firefox window is less than the width of the div (1000px) we should see an orizontal scrollbar that allows us to see the entire content of the page. Well, this happens using Safari, Opera, IE7, but NOT using FireFox 3!

Infact, the browser makes a strange effect. It simply cut off contents without showing the scrollbar.
On the contrary if we change the float su “left” on the Css, like this:

#wrapper {width:1000px; float:left; background:#CC66FF;}

Firefox works well and we have the scrollbar.
If you have an image to insert “inline” you can appreciate very well this “problem.

What do you think about? Let me know!

Written by freedance

27 Agosto 2008 alle 15:39

Pubblicato in Css / Xhtml

Bug su FireFox 3: float right

con 2 commenti

Ciao a tutti,
sto cercando di capire il perchè e se è effettivamente un bug della nuova release di Firefox.
Fatto stà che ho trovato un comportamento strano del browser se utilizzo il float:right.

L’esempio è facilmente ripetibile da tutti voi.

Markup, direttamente nel body, un div, così:

<body>
<div id=”wrapper”></div>
</body>

A cui associamo questa semplice riga di Css:

#wrapper {width:1000px; float:right; background:#CC66FF;}
(ovviamente la dimensione del div è a piacere)

Cosa succede a questo punto? Se la nostra risoluzione o la nostra finestra di Firefox è minore alla dimensione del div (1000px) dovremmo vedere una scrollbar orizzontale che ci permette di vedere tutto il contenuto della pagina. Bhe questo succede con Safari, Opera, IE7, ma non con FireFox 3.

Infatti il browser si comporta in modo strano. Semplicemente “taglia” i contenuti senza mostrare la scrollbar.
Facendo una prova veloce sul Css e cambiamo il float su “left”, ossia:

#wrapper {width:1000px; float:left; background:#CC66FF;}

tutto torna alla normalità e il browser mostra correttamente lo scorrimento.
Se avete un’immagine da inserire “inline” vi accorgerete meglio di questo strano comportamento.

Aspetto risposte o confortanti conferme!

Written by freedance

27 Agosto 2008 alle 13:14

Pubblicato in Css / Xhtml