PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.info.authoring.html > Table-like behaviour with CSS
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Table-like behaviour with CSS

Réponse
 
LinkBack Outils de la discussion
Vieux 28/04/2008, 16h45   #1
André Wagner
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Table-like behaviour with CSS

Hello!

(please read this message using fixed-font)

I'm writting a website with boxes of content. The number of cells in
each row might change depending on the browser window size, and the
content will be something like this:

AAAAA BBBBB CCCCF
AAAAA BBBBB
BBBBB
BBBBB

DDDDD EEEEE FFFFF
EEEEE FFFFF
EEEEE FFFFF
EEEEE

I'm trying to use this box model in CSS:

.caixa {
width: 190px;
height: 150px;
margin: 0 10px 10px 0;
float: left;
display: block;

}

It works, but the problem is that I don't want a fixed height, I want
the height to auto adjust (pretty much like a table in HTML).

If I remove the height attribute, I get something like this:

AAAAA BBBBB CCCCC
AAAAA BBBBB
BBBBB FFFFF
DDDDD BBBBB FFFFF
FFFFF
EEEEE
EEEEE
EEEEE
EEEEE

Please me! What can I do to get the first behaviour?

Thank you in advance!

André
  Réponse avec citation
Vieux 28/04/2008, 17h11   #2
Jonathan N. Little
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Table-like behaviour with CSS

André Wagner wrote:
> Hello!
>
> (please read this message using fixed-font)
>
> I'm writting a website with boxes of content. The number of cells in
> each row might change depending on the browser window size, and the
> content will be something like this:
>
> AAAAA BBBBB CCCCF
> AAAAA BBBBB
> BBBBB
> BBBBB
>
> DDDDD EEEEE FFFFF
> EEEEE FFFFF
> EEEEE FFFFF
> EEEEE
>
> I'm trying to use this box model in CSS:
>
> .caixa {
> width: 190px;
> height: 150px;
> margin: 0 10px 10px 0;
> float: left;
> display: block;
>
> }
>
> It works, but the problem is that I don't want a fixed height, I want
> the height to auto adjust (pretty much like a table in HTML).
>
> If I remove the height attribute, I get something like this:
>
> AAAAA BBBBB CCCCC
> AAAAA BBBBB
> BBBBB FFFFF
> DDDDD BBBBB FFFFF
> FFFFF
> EEEEE
> EEEEE
> EEEEE
> EEEEE
>
> Please me! What can I do to get the first behaviour?
>
> Thank you in advance!



You cannot. You cannot specify a "virtual grid". You either have to set
a fixed height to accommodate your max content and have the floats line
up their tops as they create their virtual rows to the available window
width. Or you will have to set a fix number of "cells" per row and use
clear, no advantage over table.

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h14.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07353 seconds with 10 queries