Friday, October 11, 2013

CSS float and clear property




Sometimes, we use CSS float property to push an element left or right so the next element can be wrapped around,. CSS code:
float:right;
 What happen, if next  element does not want to be wrapped, we can use CSS property clear to not allow  floating elements  on the left or the right side, CSS code:
clear:both;

Example 1: in WikiWP blogger template,  the message body is too far from content, this is due to
clear:both; are use, remove clear:both; in CSS to fix the problem

Example 2: footer is in  same row as content, we need to add clear:both; before footer CSS to put the
footer down as a new line.

No comments:

Post a Comment