Grow your CSS skills. Land your dream job.

DIV keep on moving inside table cell

  • # March 31, 2013 at 4:53 am

    Hi Guys,

    Lately im applying PHP calendar to display info on each day inside the calendar.
    There is small DIV on each day on top right inside each day inside the calendar.

    Whenever there is data fill up inside the day box,the DIV keep on moving relatively with the text.

    Here’s the image >>
    [Image from Dropbox](http://www.dropbox.com/s/cl1k6ly26udj6f4/CSS_DIV.png “http://www.dropbox.com/s/cl1k6ly26udj6f4/CSS_DIV.png”)

    here’s the DIV’s css style

    div.day-number
    {background:#999; padding:5px; color:#fff; font-weight:bold; float:right; margin:-5px -5px 0 0; width:20px; text-align:center;}

    Can somebody help me on **how to make the DIV always ON TOP RIGHT of each calendar table cell even there is text inside the .**

    Thanks
    Azhan

    # March 31, 2013 at 5:10 am

    try to set vertical-align:top for td tag

    # March 31, 2013 at 9:52 am

    thanks daffy, it really works! :)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".