Hướng dẫn bootstrap calendar w3schools

Learn how to create a Calendar with CSS.

How To Create a Calendar Layout

  • August
    2021

  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • Su
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31

Try it Yourself »

Step 1] Add HTML:

Example


 

       

  •    

  •    
  • August
    2021

  •  


     
  • Mo

  •  
  • Tu

  •  
  • We

  •  
  • Th

  •  
  • Fr

  •  
  • Sa

  •  
  • Su


     
  • 1

  •  
  • 2

  •  
  • 3

  •  
  • 4

  •  
  • 5

  •  
  • 6

  •  
  • 7

  •  
  • 8

  •  
  • 9

  •  
  • 10

  •  
  • 11

  •   ...etc

Step 2] Add CSS:

Example

ul {list-style-type: none;}
body {font-family: Verdana, sans-serif;}

/* Month header */
.month {
  padding: 70px 25px;
  width: 100%;
  background: #1abc9c;
  text-align: center;
}

/* Month list */
.month ul {
  margin: 0;
  padding: 0;
}

.month ul li {
  color: white;
  font-size: 20px;
  text-transform: uppercase;
  letter-spacing: 3px;
}

/* Previous button inside month header */
.month .prev {
  float: left;
  padding-top: 10px;
}

/* Next button */
.month .next {
  float: right;
  padding-top: 10px;
}

/* Weekdays [Mon-Sun] */
.weekdays {
  margin: 0;
  padding: 10px 0;
  background-color:#ddd;
}

.weekdays li {
  display: inline-block;
  width: 13.6%;
  color: #666;
  text-align: center;
}

/* Days [1-31] */
.days {
  padding: 10px 0;
  background: #eee;
  margin: 0;
}

.days li {
  list-style-type: none;
  display: inline-block;
  width: 13.6%;
  text-align: center;
  margin-bottom: 5px;
  font-size:12px;
  color: #777;
}

/* Highlight the "current" day */
.days li .active {
  padding: 5px;
  background: #1abc9c;
  color: white!important
}

Try it Yourself »



Try it Yourself Examples

This Bootstrap tutorial contains hundreds of Bootstrap examples.

With our online editor, you can edit the code, and click on a button to view the result.

1

  • 2
  • 3
  • 4
  • 5
  • Start the Exercise

    Bootstrap Quiz Test

    Test your Bootstrap skills at W3Schools!

    Start Bootstrap Quiz!

    My Learning

    Track your progress with the free "My Learning" program here at W3Schools.

    Log into your account, and start earning points!

    This is an optional feature, you can study W3Schools without using My Learning.

    Bootstrap References

    At W3Schools you will find a complete Bootstrap reference of all CSS classes, Components, and JavaScript plugins - all with "Try it Yourself" examples:

    Bootstrap Themes / Templates

    We have made some Bootstrap Templates you can play around with. They are completely free to use:

    Bootstrap 5 vs. Bootstrap 3 & 4

    This tutorial follows Bootstrap 3, which was released in 2013. However, we also cover newer versions; Bootstrap 4 [released 2018] and Bootstrap 5 [released 2021].

    Bootstrap 5 is the newest version of Bootstrap; with new components, faster stylesheets, more responsiveness etc. It supports the latest, stable releases of all major browsers and platforms. However, Internet Explorer 11 and down is not supported.

    The main differences between Bootstrap 5 and Bootstrap 3 & 4, is that Bootstrap 5 has switched to JavaScript instead of jQuery.

    Note: Bootstrap 3 and Bootstrap 4 is still supported by the team for critical bugfixes and documentation changes, and it is perfectly safe to continue to use them. However, new features will NOT be added to them.

    Did You Know?

    W3.CSS is an excellent alternative to Bootstrap.

    W3.CSS is smaller, faster, and easier to use.

    If you want to learn W3.CSS, go to our W3.CSS Tutorial.



    Chủ Đề