Calendar Widget

Preview


About

This is a simple web calendar, which shows your system date in day, week, month and year format.

How to add?

By hotlinking:

Put this script on your HTML document.

<script src="https://404city.neocities.org/widget/calendar.js"></script>

By uploading on your site:

Click here to download script! Then, upload it on your site and put this line on your HTML document.

<script src="YOUR_SCRIPT_PATH_HERE"></script>

  • Make sure the script is located after <body> but before </body>:
  • The calendar will instantly pop-up where you put the script!

ID and Class Informations:

Here are the ID and Class definitions of calendar's elements. You can use them on your own CSS file to customize your calendar!


ID/ClassElement TypeDescription
#calendardivMain body of the calendar.
#calendarHeaderdivDisplays month and year.
#calendarGriddivContainer grid of calendar cells and days of the week.
.calendarDayOfTheWeekdivCells which represents the days of the week.
.calendarCelldivDefault cells which are the day numbers of the calendar..
.calendarNonMonthDaydivMarks the days outside the current month. Make sure to put it after the .calendarCell class.
.calendarTodaydivMarks the current day. Make sure to put it after the .calendarCell class.

Default CSS Definements

Here are the default CSS properties of elements that already defined in your widget file. (You don't have to define them in your own CSS file for second time.)

:where(#calendarHeader, .calendarDayOfTheWeek, .calendarCell) {
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, Helvetica, sans-serif;
    border: 1px solid black;
    color: black;
    cursor: default;
    user-select: none;
}
:where(#calendar) {
    box-sizing: border-box;
    display: grid;
    grid-template-rows: 1.25fr 7fr;
    height: 260px;
    width: 260px;
    border: 1px solid black;
    padding: 2px;
    gap: 2px;
    font-size: 14px;
}
:where(#calendarGrid) {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}
:where(#calendarHeader) {
    font-weight: bold;
    font-size: 1.5em;
    white-space: nowrap;
}
:where(.calendarDayOfTheWeek) {
    font-weight: bold;
}
:where(.calendarNonMonthDay) {
    color: gray;
}
:where(.calendarToday) {
    background-color: black;
    color: white;
}

Update Log

12 November 2025, Wednesday
  • Removed previous and next month buttons.
  • Gap sizes are set to 2px.
9 November 2025, Sunday
  • Most of the coloring is removed.
14 August 2025, Thursday
  • Edited script source.
13 August 2025, Wednesday
  • Decreased font-size from 16px to 14px.
  • Decreased widget size from 300x300 to 260x260.
10 August 2025, Sunday
  • Widget is ready to use!