אתה יכול לוותר על ה-float, ולשים את ה-div האחד בתוך השני (כפי שכתבו למעלה) ולתת margin לאלמנט הפנימי, לדוגמא: קוד: <style type="text/css"> #rectangle_red { width:100px; height:100px; background-color: red; } #rectangle_blue { width:80px; height: 80px; background-color: blue; margin-top:10px; margin-left:10px; } </style> </head> <body> <div id="rectangle_red"> <div id="rectangle_blue"></div> </div> </body> באשכול ה-FAQ שמעוגן, יש את התגובה שלי על CSS Float עם קישורים להסברים על התכונה הזאת: http://www.fresh.co.il/vBulletin/sh...030#post3563128
<style type="text/css"> #rectangle_red { width:100px; height:100px; background-color: red; } #rectangle_blue { width:80px; height: 80px; background-color: blue; margin-top:10px; margin-left:10px; } </style> </head> <body> <div id="rectangle_red"> <div id="rectangle_blue"></div> </div> </body>