12 – HOW TO ADD BOOTSTRAP TO DJANGO USING CDN – INVOICE MANAGEMENT SYSTEM

Spread the love

Get the CDN URL from this link

  1. Copy both the css and javaScrip file

https://www.bootstrapcdn.com/

Add these code in the home page to confirm that bootstrap is working on the page

<head>
	<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
	<link href="{% static 'css/stylesheet.css' %}" rel="stylesheet">
</head>

<h1>{{title}}</h1>

<button class="btn btn-danger">Click Me</button>

<div class="row">
	<div class="col-sm-6 myClass">
		test 1
	</div>
	
	<div class="col-sm-6 myClass">
		test2
	</div>
</div>

2. In the css file, apply some style on the page

body{
	/*background-color: blue;*/
}

.myClass{
	text-align: center;
	border-width: 1px;
	border-style: solid;
}

Spread the love

About the author

arbadjie

Hi, I'm Abdourahman Badjie, an aspiring developer with obsession for anything coding and networking. This blog is dedicated to helping people learn to develop web applications using django framework.

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *