Vizlogix

Back to blog

How to make calendar day backgrounds

Posted on Thursday, March 7th, 2013 at 2:14 pm by Ken

The following demonstrates how I created the neat, little background for the dates that looks somewhat like a calendar page. I used to employ a fixed, graphical background, but I have changed to a corner-radiused, shaded area that should work well on most modern browsers at various resolutions.

Here is the css (NOTE: You may wish to adjust your colors so they match the rest of your page's color scheme):

strong.date {
    background: #597BF1;
    color: white;
    display: block;
    float: left;
    font-size: 0.8em;
    width: 6em;
    line-height: 2em;
    margin: 10px 10px 0px 0px;
    padding: 1px;
    text-align: center;
    text-transform: uppercase;
    border-radius: 9px;
    -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2), inset 0 0 50px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2), inset 0 0 50px rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2), inset 0 0 50px rgba(0, 0, 0, 0.1);
}

strong.date span {
    color: black;
    background-color: white;
    -webkit-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2), inset 0 0 50px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 0 4px rgba(0, 0, 0, 0.2), inset 0 0 50px rgba(0, 0, 0, 0.1);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2), inset 0 0 50px rgba(0, 0, 0, 0.1);
    display: block;
    font-size: 2.5em;
    line-height: 1.8em;
    border-radius: 0 0 8px 8px;
}

Categories: News General
Tags: Calendar Formatting

Comments

By: Winter on Tuesday, July 9th, 2013

Kudos to you! I hadn't thoguht of that!