user3181365 user3181365 - 1 month ago 7
Javascript Question

Basic Bootstrap not working

I am trying to learn Bootstrap following this Orielly Bootstrap book.

This is the simple html code:

<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 101 Template</title>
<link href="css/bootstrap.css" rel="stylesheet">
</head>
<body>
<h1>Hello, world!</h1>
<script src="js/bootstrap.min.js"></script>
<div class="row">
<div class="span8">Span 8</div>
<div class="span4">Span 4</div>
</div>
</body>
</html>


I have downloaded Bootstrap and I have
bootstrap.css
and
bootstrap.min.js
at correct places. As per the code, we should get a row with 2 columns. But I am getting output as :

enter image description here

Please let me know what is the correct way of doing this?

Answer
class="span8"

It looks like the book you are reading is out of date. That is the syntax used in Bootstrap 2 (which is no longer supported).

Presumably you have downloaded the CSS for Bootstrap 3 or 4. Consult their documentation for the current syntax, which has changed significantly since Bootstrap 2.