#π CSS Styling
26 messages Β· Page 1 of 1 (latest)
@balmy mango
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
This is my current webpage, I chose some basic colors for now. It works.
How do I remove the white borders around the header and nav bar? I would like them to be uniform.
body {
margin-top: 0;
}
.navbar {
background-color: tomato;
}
header {
background-color: lightblue;
border: 0px;
}
This is my CSS file with the colors. But the "border" and "margin" commands dont work at all for me.
Maybe I am doing something wrong but I think it should work.
DIVs etc have a few bordery properties. I'm no CSS expert, but have you looked them up?
Also, open your web browsers dev tools, get the "inspect element" facility (may even be an entry in your right-click/ctrl-click menu popup). It should show both explicit and compute CSS properties for elements, so you can see what's in effect.
^
You're experiencing default styles
By default, paragraphs, headers, and the body have margins applied to them. And not regular margins, iirc, but margin-block margins, which are margins that apply in a specific direction depending on text direction.
You can use the inspector as they said to view the exact styles and neutralize them manually (and you might want to move said neutralizations to it's own file). typically, for more complex projects, people will utilize a "reset" css file that removes all of these and standardizes them between browsers.
I watched a youtube video, but it didnt work for me even though I copied exactly what the video did.
Is there different ones? The youtube video I watched used the ones I am, and it worked for them.
What is your browser?
a fork of FireFox
The dev tools are in the Tools->Browser Tools->Web Developer Tools. Also the ctrl-click menu has an "Inspect" entry.
Eah of those should let you inspect the CSS properties in effect on your web page directly.
They should show the explicit and computed properties, and where those properties came from (eg some enclosing element).
Yes. Imo, dev tools are amazing. I'd suggest taking inspiration from some webpages.
anyhow, edit the css in the browser directly. then after finding the perfect styling, copy it over to your local files.
Here is my HTML code:
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="{% static 'css/style.css' %}">
</head>
<body>
<header>
<h1>Scrappy</h1>
</header>
<nav class="navbar">
{% for link in nav_links %}
<a href="{{link.url}}">{{link.text}}</a>
{% endfor %}
</nav>
{% block content %}
{% endblock %}
</body>
</html>
I dont know whats breaking
but I cant find a solution
I loaded my CSS file dynamically
But some things dont work
Look at my HTML code
I found something! Yay
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.