Issue
I am a beginner to bootstrap, I have no idea why my bootstrap class mr-4 doesn't work for this code
`
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Fetch API Sandbox</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
</head>
<body>
<div class="container">
<h1 class="display-4 mb-4">Fetch API Sandbox</h1>
<div class="d-flex">
<button class="btn btn-primary mr-4" id="getText">Get Text</button>
<button class="btn btn-success mr-4" id="getUsers">Get JSON</button>
<button class="btn btn-warning mr-4" id="getPosts">Get API DATA</button>
</div>
<hr>
<div id="output"></div>
<form id="addPost">
<div class="form-group">
<input type="text" id="title" placeholder="Title" class="form-control">
</div>
<div class="form-group">
<textarea id="body" placeholder="Body" class="form-control"></textarea>
</div>
<input type="submit" value="Submit" class="btn btn-secondary">
</form>
</div>
</body>
</html>
`
I actually see no margins or paddings here, but I think they should be by default in other elements too
Solution
In Bootstrap 5.2 you need to add me
class instead of mr
class
use this code snippet
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Fetch API Sandbox</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
</head>
<body>
<div class="container">
<h1 class="display-4 mb-4">Fetch API Sandbox</h1>
<div class="d-flex">
<button class="btn btn-primary me-4" id="getText">Get Text</button>
<button class="btn btn-success me-4" id="getUsers">Get JSON</button>
<button class="btn btn-warning me-4" id="getPosts">Get API DATA</button>
</div>
<hr>
<div id="output"></div>
<form id="addPost">
<div class="form-group">
<input type="text" id="title" placeholder="Title" class="form-control">
</div>
<div class="form-group">
<textarea id="body" placeholder="Body" class="form-control"></textarea>
</div>
<input type="submit" value="Submit" class="btn btn-secondary">
</form>
</div>
</body>
</html>
Answered By - Mahammadhusain kadiwala Answer Checked By - Pedro (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.