# \[Solved\] Blog pages don't inherit the stylesheet

**URL:** <https://zola.discourse.group/t/solved-blog-pages-dont-inherit-the-stylesheet/2255>\
**Category:** Support\
**Created:** [August 12, 2024, 10:37am UTC](https://zola.discourse.group/t/solved-blog-pages-dont-inherit-the-stylesheet/2255 "2024-08-12T10:37:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![T3kla](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/t3kla/32/1284_2.png) [@T3kla](https://zola.discourse.group/u/T3kla)\
**Post date:** [August 12, 2024, 10:37am UTC](https://zola.discourse.group/t/solved-blog-pages-dont-inherit-the-stylesheet/2255/1 "2024-08-12T10:37:03Z")

</div>

I recently started working on my portfolio once again. I updated Zola and changed the main structure of my site to be just like the [overview tutorial].([Overview | Zola](https://www.getzola.org/documentation/getting-started/overview/))

All was fun and games until I started creating blog pages and discovered they don’t use the style sheet at all, so they are pure black text over a white background.

My blog: [T3kla’s Portfolio and Blog](https://t3kla.github.io/blog/)

blog.html

```html
{% extends "base.html" %}
{% block content %}
<div class="blog">
  {% for page in section.pages %}
  <div class="blog-entry">
    <p class="blog-entry-date">{{ page.year }}-{{ page.month }}-{{ page.day }}</p>
    <div class="blog-entry-separator"></div>
    <div class="blog-entry-main">
      <a class="blog-entry-title" href="{{ page.permalink | safe }}">{{ page.title }}</a>
      <div class="blog-entry-tags">
        {% for tag in page.extra.tags %}
        <p class="blog-entry-tag">{{tag}}</p>
        {% endfor %}
      </div>
    </div>
    <div class="blog-entry-separator"></div>
    <div class="blog-entry-extra">
      <p class="blog-entry-words">{{ page.word_count }} words</p>
      <p class="blog-entry-time">{{ page.reading_time }} minutes</p>
    </div>
  </div>
  {% endfor %}
</div>
{% endblock content %}

```

blog-page.html

```html
{% extends "base.html" %} 
{% block content %}
<h1 class="title">{{ page.title }}</h1>
<p class="subtitle"><strong>{{ page.date }}</strong></p>
{{ page.content | safe }}
{% endblock content %}

```

---

<div class="post-metadata">

**Author:** ![welpo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/welpo/32/1087_2.png) [@welpo](https://zola.discourse.group/u/welpo)\
**Post date:** [August 12, 2024, 11:12am UTC](https://zola.discourse.group/t/solved-blog-pages-dont-inherit-the-stylesheet/2255/2 "2024-08-12T11:12:33Z")

</div>

What does `base.html` look like?

On your pages, you have:

```auto
<link rel="stylesheet" href="../style.css" />

```

Since it’s a relative path to the stylesheet (`../…`), it can only find the file on the homepage. On the blogs, it looks for it on `https://t3kla.github.io/blog/style.css` instead of `https://t3kla.github.io/style.css`.

You can fix this by using something like this on your template (wherever the CSS loading is happening):

```auto
<link rel="stylesheet" href="{{ get_url(path="style.css", cachebust=true) | safe }}" />

```

---

<div class="post-metadata">

**Author:** ![T3kla](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/t3kla/32/1284_2.png) [@T3kla](https://zola.discourse.group/u/T3kla)\
**Post date:** [August 12, 2024, 11:20am UTC](https://zola.discourse.group/t/solved-blog-pages-dont-inherit-the-stylesheet/2255/3 "2024-08-12T11:20:24Z")

</div>

You solved it, thank you!

Old base.html:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>{{config.title}}</title>
    <link rel="stylesheet" href="../style.css" />
    <script src="../script.js"></script>
  </head>
  <body>
    {% block content %} {% endblock %}
  </body>
</html>

```

New base.html:

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>{{config.title}}</title>
    <link rel="stylesheet" href='{{ get_url(path="style.css", cachebust=true) | safe }}' />
    <script src="../script.js"></script>
  </head>
  <body>
    {% block content %} {% endblock %}
  </body>
</html>

```

---

<div class="post-metadata">

**Author:** ![welpo](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/welpo/32/1087_2.png) [@welpo](https://zola.discourse.group/u/welpo)\
**Post date:** [August 12, 2024, 11:31am UTC](https://zola.discourse.group/t/solved-blog-pages-dont-inherit-the-stylesheet/2255/4 "2024-08-12T11:31:24Z")

</div>

Great! Be careful with the `script.js` part, as it’ll have the same problem.
