Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calendar Control with External CSS

Status
Not open for further replies.

nevets2001uk

IS-IT--Management
Jun 26, 2002
609
GB
Hi,

I have a asp.net calendar control on one of my web pages and would like to control it's appearance via my external cascading style sheet. The code for the control is currently as follows...

<asp:Calendar
ID=&quot;calCalendar&quot;
cssClass=&quot;CalendarControl&quot;
DayNameFormat=&quot;FirstLetter&quot;
Font-Size=&quot;12px&quot;
PrevMonthText=&quot;<img src='schemes/bluegrey/images/previousarrow.gif' border='0' alt='Previous Month' />&quot;
NextMonthText=&quot;<img src='schemes/bluegrey/images/nextarrow.gif' border='0' alt='Next Month' />&quot;
ShowNextPrevMonth=&quot;True&quot;
Width=&quot;100%&quot;
DayStyle-BackColor=&quot;#D9E4E8&quot;
CellSpacing=&quot;2&quot;
BorderStyle=&quot;None&quot;
TitleStyle-BackColor=&quot;Transparent&quot;
TitleStyle-Font-Bold=&quot;True&quot;
OtherMonthDayStyle-ForeColor=&quot;#B2B2B2&quot;
DayHeaderStyle-BackColor=&quot;#D0D0D0&quot;
Runat=&quot;Server&quot; />

I've tried this in my css but it didn't seem to affect the appearance at all

.calendarcontrol { daynameformat : firstletter; callspacing : 2px; }

and after removing those lines from the asp.net code it reverts to it's default appearance for those elements.

Is it possible to control all of the above elements with CSS?

Thanks,

Steve

Steve Gordon
 
You have a typo in callspacing that will prevent you from controlling that property.

I don't think daynameformat is a CSS property to begin with.

Code:
.CalendarControl
{ cellspacing:2px;font-size:12px;borderstyle:none;width:100% }

They look like the ones you want to override.

Jeff
 
I did wonder about the daynameformat etc! So it's not going to be possible to control others such as...

OtherMonthDayStyle-ForeColor=&quot;#B2B2B2&quot;
DayHeaderStyle-BackColor=&quot;#D0D0D0&quot;

...then? What I'm doing is a skinned site so I need to change those in my CSS if I can.

Looks like I may end up spending some time on a suitable workaround...darn!

If anyone has a suggestion I'd welcome it!

Steve Gordon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top