Ecco un esempio di pagina HTML che mostra un calendario per aprile 2025, progettato per essere esteticamente gradevole e funzionale. Il calendario è reattivo e si adatta automaticamente alle dimensioni del contenitore.
html Copy code
<!DOCTYPE html>
<html lang="it">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>Calendario Aprile 2025</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.calendar-container {
background-color: #fff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 8px;
overflow: hidden;
width: 90%;
max-width: 600px;
}
.calendar-header {
background-color: #4CAF50;
color: white;
text-align: center;
padding: 20px 0;
font-size: 24px;
}
.calendar {
width: 100%;
border-collapse: collapse;
}
.calendar th, .calendar td {
width: 14.28%;
text-align: center;
padding: 15px 0;
}
.calendar th {
background-color: #f2f2f2;
}
.calendar td {
background-color: #fff;
transition: background-color 0.3s;
}
.calendar td:hover {
background-color: #e0e0e0;
}
.calendar .today {
background-color: #4CAF50;
color: white;
border-radius: 50%;
width: 40px;
height: 40px;
display: inline-block;
line-height: 40px;
}
</style>
</head>
<body>
<div class="calendar-container">
<div class="calendar-header">Aprile 2025</div>
<table class="calendar">
<thead>
<tr>
<th>Lun</th>
<th>Mar</th>
<th>Mer</th>
<th>Gio</th>
<th>Ven</th>
<th>Sab</th>
<th>Dom</th>
</tr>
</thead>
<tbody>
<tr>
<td></td>
<td class="today">1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
<tr>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
</tr>
<tr>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
</tr>
<tr>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
<td>26</td>
<td>27</td>
</tr>
<tr>
<td>28</td>
<td>29</td>
<td>30</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
In questo esempio, il calendario inizia con lunedì e evidenzia il primo giorno del mese. Il design è semplice e pulito, con una combinazione di colori verde e bianco per una visualizzazione chiara. Il calendario è anche reattivo, garantendo una buona visualizzazione su dispositivi di diverse dimensioni.