css Get element to move to right within other element -
i working on calendar app , having trouble getting date move want within day. specifically, square date, cannot day number move top right. have tried float:right , align-text: right without success. here jsfiddle , code:
css
table.calendar { table-layout: fixed; width: 520px; } span.day-number { vertical-align:top; // text-aligh:right; background:#999; z-index:2; top:0px; align-right:+70px; padding:4px; color:#fff; font-weight:bold; width:18px; text-align:center; } td.calendar-day, td.calendar-day-np { // float:left; vertical-align:top; width:70px; padding:5px 25px 5px 5px; border-bottom:1px solid #999; border-right:1px solid #999; } div.event { display:inline; position:relative; z-index:3; top:15px; text-width: 70px; }
html
<table class="calendar"> <tr> <td>mon</td> <td>tue</td> <td>wed</td> <td>thur</td> <td>fri</td> </tr> <tr> <td class="calendar-day"><span class="day-number">14</span><p> </p><p> </p></td> <td class="calendar-day"><span class="day-number">15</span><div> </div> </td> <td class="calendar-day"><span class="day-number">16</span><div class="event">4:00pm<br>go gym</div></td> <td class="calendar-day"></td> <td class="calendar-day"><span class="day-number">18</span><p> </p><p> </p></td> </tr></table>
css not strong suite appreciate suggestions.
have tried:
http://jsfiddle.net/sanpopo/byrtn/
table.calendar { table-layout: fixed; width: 520px; } span.day-number { vertical-align:top; background:#999; z-index:2; top:0px; padding:4px; color:#fff; font-weight:bold; width:18px; text-align:center; float:right; } td.calendar-day, td.calendar-day-np { // float:left; vertical-align:top; width:70px; border-bottom:1px solid #999; border-right:1px solid #999; } div.event { display:inline; position:relative; z-index:3; top:30px; text-width: 70px; }
Comments
Post a Comment