Check out my project: http://jsfiddle.net/yL0o1cy0/
.calendar {
width: 850px;
height: 500px;
background-color: #141414;
border-radius: 10px;
padding-top: 10px;
margin-top: 15px;
margin-left: 15px;
}
#calendartest1 {
width: 778px;
height: 200px;
position: relative;
margin-left: auto;
margin-right: auto;
}
#calendartest2 {
width: 778px;
height: 200px;
position: relative;
margin-left: auto;
margin-right: auto;
margin-top: 50px;
}
#calendartest1 h2 {
color: #999999;
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
}
#calendartest2 h2 {
color: #999999;
text-align: center;
margin-top: 0px;
margin-bottom: 0px;
}
.day {
width: 110px;
float: left;
border-left: 1px solid #404040;
}
.dayname {
text-align: center;
background-color: #49CEFF;
height: 30px;
border-radius: 0px 5px 0px 5px;
margin-left: 3px;
margin-right: 3px;
margin-top: -15px;
}
.dayname p {
padding-top: 5px;
color: white;
font-weight: bold;
text-shadow: 0px 0px 10px black;
}
.daycontent {
text-align: center;
margin-top: 5px;
height: 160px;
}
.daycontent a:link,
a:visited {
display: block;
margin-left: 2px;
margin-right: 2px;
margin-top: 2px;
padding-top: 2px;
padding-bottom: 2px;
color: white;
text-decoration: none;
font-size: 12px;
}
.daycontent a:hover,
a:active {
background-color: black;
color: #49ceff;
}
<div class="calendar">
<div id="calendartest1">
<h2>Test1</h2>
<div class="day">
<div class="dayname">
<p>Monday</p>
</div>
<div class="daycontent">
<a href="">test</a>
<a href="">test</a>
<a href="">test</a>
</div>
</div>
// more days...
</div>
<div id="calendartest2">
<h2>Test2</h2>
<div class="day">
<div class="dayname">
<p>Monday</p>
</div>
<div class="daycontent">
<a href="">test</a>
<a href="">test</a>
<a href="">test</a>
</div>
</div>
// more days...
</div>
</div>
I'm looking to dynamically change the background color of each day's box in my calendar. For example, on Monday I want the background to change from #49CEFF;
to #242424;
, and likewise for other days. Any suggestions on how to achieve this?