I’m trying to style my HTML code but it’s not working properly I tried to add the style tag inside the load static tag and also I tried to add block mycss tag
{% extends 'base.html' %}
{% load static %}
<style>
.divider:after,
.divider:before {
content: "";
flex: 1;
height: 1px;
background: #eee;
}
</style>
{% block content%}
<section class="vh-100">
<div class="container py-5 h-100">
<div class="row d-flex align-items-center justify-content-center h-100">
<div class="col-md-8 col-lg-7 col-xl-6">
<img src="https://mdbcdn.b-cdn.net/img/Photos/new-templates/bootstrap-login-form/draw2.svg"
class="img-fluid" alt="Phone image">
</div>
<div class="col-md-7 col-lg-5 col-xl-5 offset-xl-1">
<form>
<!-- Email input -->
<div class="form-outline mb-4">
<input type="email" id="form1Example13" class="form-control form-control-lg" />
<label class="form-label" for="form1Example13">Email address</label>
</div>
<!-- Submit button -->
<button type="submit" class="btn btn-primary btn-lg btn-block">Sign in</button>
<div class="divider d-flex align-items-center my-4">
<p class="text-center fw-bold mx-3 mb-0 text-muted">OR</p>
</div>
<a class="btn btn-primary btn-lg btn-block" style="background-color: #3b5998" href="#!"
role="button">
<i class="fab fa-facebook-f me-2"></i>Continue with Facebook
</a>
<a class="btn btn-primary btn-lg btn-block" style="background-color: #55acee" href="#!"
role="button">
<i class="fab fa-twitter me-2"></i>Continue with Twitter</a>
</form>
I’m trying to style my HTML code but its not working properly I didn’t add my full HTML code anyone please help me to solve this
2
Answers
but as i see you not use your divider class in you code
if you want to style div elements you should use this
Template inheritance
works the same way class inheritance works in OOP. So if you want to inherit base.html and want to update some parts, then you block that part that you want to update, and then in another template you can use the same block to add new content. For example, if you want to update CSS in layout.html, which is extending from base.htmlbase.html
layout.html
So when you visit base.html you’ll see "Base" and if you visit layout.html you’ll see "Layout" with their own stylesheet applied.