Permalink
Browse files

making vertical margins be respected between divs that only contain o…

…ther floating divs with a css hack

Signed-off-by: Balint Erdi <balint.erdi@gmail.com>
  • Loading branch information...
balinterdi committed Mar 15, 2009
1 parent 9ee7bd4 commit 96f83293a40056e8a250f6a64410066637668315
Showing with 13 additions and 0 deletions.
  1. +3 −0 views/expenses.haml
  2. +10 −0 views/main.sass
View
@@ -61,10 +61,13 @@
#to-label To
#to-input
%input.expense_date#spent-at-to
+ #pusher
#expenses
%ul#expenses-list
/ = partial :expense, :collection => @expenses
+ #pusher
+
#sum
#sum-text Total amount:
#sum-amount 0
View
@@ -179,6 +179,16 @@ ul#expenses-list
+float-align-right
:width 20%
+// This is a CSS hack.
+// "Since a float is not in the flow, non-positioned block boxes created aft. and bef. the float box flow vert.lly as if the float didn't exist."
+// As a consequence, vertical margins are only taken into account
+// between two block elements which do not float.
+// So the below "pusher" needs to be added as a child to all divs
+// where margin-top should be respected.
+
+#pusher
+ :clear both
+
#tags
:margin 10px 0px

0 comments on commit 96f8329

Please sign in to comment.