- This topic is empty.
-
AuthorPosts
-
November 21, 2008 at 11:58 am #23616warnewMember
I’ve some floated divs int the middle of this page: http://nimfa.hu/. Sometimes there is only one div in a row, it’s supposed to be 2.
the div looks like this:
There is a php wich makes sure, the cover image is always 100px wide.
with the css:
Code:.book {
float : left;
width : 300px;
font-family : Verdana;
font-size : 10px;
line-height : 12px;
background-color : #f1f1e7;
background-image : url(‘/images/bookdivbg.png’);
background-repeat : repeat-x;
height : 190px;
overflow : hidden;
}
.price {
color : #eb4703;
font-weight : bold;
font-family : Verdana;
font-size : 10px;
line-height : 12px;
}.book h1 {
font-family : Georgia;
font-weight : bold;
font-size : 11px;
line-height : 13px;
color : #0881c6;
}.book a {
text-decoration : none;
}.book h2 {
font-size : 10px;
line-height : 13px;
font-family : Verdana;
font-weight : bold;
margin-top : 10px;
}.book .cover {
border : 1px solid black;
float : left;
margin : 10px;
}how can i be sure, there are always two div in a row?
November 21, 2008 at 7:15 pm #51330JonzMemberYou have it (booklist) displaying as a table but haven’t assigned any cells. Just use the floats you don’t really need to display in a tabular form just use the floats.
November 21, 2008 at 8:51 pm #51331warnewMemberi don’t really see the connection, but it seem’s to work, so wo cares ;)
(i used to use the display: table; to avoid the parent div’s collapse with only floating elements.)
thanks
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.