cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              main
  table.calendar
    caption.calendar__banner--month
        h1 March
    thead
      tr
        th.calendar__day__header Sun
        th.calendar__day__header Mon
        th.calendar__day__header Tues
        th.calendar__day__header Wed
        th.calendar__day__header Thurs
        th.calendar__day__header Fri
        th.calendar__day__header Sat
    tbody
      tr
        td.calendar__day__cell
        td.calendar__day__cell
        td.calendar__day__cell
        td.calendar__day__cell 1
        td.calendar__day__cell 2
        td.calendar__day__cell 3
        td.calendar__day__cell 4
      tr
        td.calendar__day__cell 5
        td.calendar__day__cell 6
        td.calendar__day__cell 7
        td.calendar__day__cell 8
        td.calendar__day__cell 9
        td.calendar__day__cell 10
        td.calendar__day__cell 11
      tr
        td.calendar__day__cell 12
        td.calendar__day__cell 13
        td.calendar__day__cell 14
        td.calendar__day__cell(data-moon-phase="New Moon") 15
        td.calendar__day__cell 16
        td.calendar__day__cell 17
        td.calendar__day__cell 18
      tr
        td.calendar__day__cell 19
        td.calendar__day__cell 20
        td.calendar__day__cell 21
        td.calendar__day__cell 22
        td.calendar__day__cell 23
        td.calendar__day__cell 24
        td.calendar__day__cell 25
      tr
        td.calendar__day__cell 26
        td.calendar__day__cell 27
        td.calendar__day__cell 28
        td.calendar__day__cell(data-moon-phase="Full Moon") 29
        td.calendar__day__cell 30
        td.calendar__day__cell(data-bank-holiday="Good Friday") 31
        td.calendar__day__cell
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);

$red: #e66053;
$black: #4E4F4A;
$cream: #F6E9DC;

$thin-border: 2px solid $red;

body {
  background-color: $red;
  color: $black;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat';
  font-weight: 700;
  min-height: 100vh;
}

main {
  background-color: $cream;
  flex-basis: 980px;
}

.calendar {
  table-display: fixed;
  width: 100%;
}

.calendar__day__header,
.calendar__day__cell {
  border: $thin-border;
  text-align: center;
  width: 100% / 7; // fix width
  vertical-align: middle;
  &:first-child {
    border-left: none;
  }
  &:last-child {
    border-right: none;
  }
}

.calendar__day__header,
.calendar__day__cell {
  padding: .75rem 0 1.5rem;
}

.calendar__banner--month {
  text-align: center;
  padding: .75rem;
  h1 {
    background-color: $black;
    color: $cream;
    display: inline-block;
    font-size: 3rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    padding: .5rem 2rem;
    text-transform: uppercase;
  }
}

.calendar__day__header {
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.calendar__day__cell {
  font-size: 4rem;
  position: relative;
}

tr:nth-child(odd) > .calendar__day__cell:nth-child(odd) {
  color: $red;
}

tr:nth-child(even) > .calendar__day__cell:nth-child(even) {
  color: $red;
}

.calendar__day__cell[data-moon-phase] {
  background-color: $red;
  color: $black;
  &:after {
    content: attr(data-moon-phase);
    color: $cream;
    display: block;
    font-weight: 400;
    font-size: .75rem;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1rem;
    text-transform: uppercase;
  }
}

.calendar__day__cell[data-bank-holiday] {
  background-color: $black;
  border-color: $black;
  color: $cream;
  &:after {
    content: attr(data-bank-holiday);
    color: $cream;
    display: block;
    font-size: .75rem;
    font-weight: 400;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 1rem;
    text-transform: uppercase;
  }
}

            
          
!
999px
Loading ..................

Console