#CSS Issue
21 messages · Page 1 of 1 (latest)
That's not unusual. Please try explaining what is confusing. Someone may be able to help then
I want to use CSS to make my html looks good, but I have a problem syncing it
I dont know how to the href work with this framework, I checked the documentation
It tolds me something about static files, but I cant understand them
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/5.0/howto/static-files/
STATIC_URL = 'static/'```
I tried doing that, creating a static folder and adding to it ''index.css'' for my index.html file
Tried to sync it in my html href static/index.css but didnt work
Give this a read. https://learndjango.com/tutorials/django-static-files-and-templates
CSS Issue
If you're still confused, show your template code.
It didnt work
{% load static %}
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Minimalista y Moderno</title>
<link rel="stylesheet" href="{% static 'css/base.css' %}">
</head>
<body>
<header>
<h1>Minimalista y Moderno</h1>
</header>
<main>
<section>
<h2>¡Bienvenido!</h2>
<p>Este es un diseño minimalista y moderno.</p>
</section>
</main>
<footer>
<p>© 2024 Minimalista y Moderno</p>
</footer>
</body>
</html>
This is my Html
How does django know to look in that directory?
Added the Load thing at the top and the href in the Html
Also in my settings.py, there is a STATIC_URL = 'static/'
From the article I shared,
STATICFILES_DIRS tells Django where to look for static files in a Django project, such as a top-level static folder
So, how can I make it work?