Styles and Scripts

Let's add some makeup and motion

Styles and Scripts

What is a website without some css or even some javascript, even though you just hate it?

Let’s add some css,

Should I create css file inside assets or static ?

Well I am letting you to explore that, but for now I am going ahead and creating it inside static folder, create static folder under root directory, add main.css inside it

header ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: #333333;
}

header ul li {
  float: left;
  color: #ffffff;
  margin: 10px;
}

main {
  min-height: 80vh;
  background-color: #e9e9e9;
}

footer {
  background-color: #3d3d3d;
  text-align: center;
  color: #ffffff;
}

Scripts

Generally scripts are added all the way down inside the footer, open footer.html and add the below code

<script src="/js/main.js" language="javascriptdefer></script>

Now create the file main.js inside static/js, add some script


 window.addEventListener('DOMContentLoaded', (event) => {
    alert("Loaded succesfully");
});

Coming next

Shortcode vs Partials : How to choose between a shortcode and a partial?