0% found this document useful (0 votes)
5 views3 pages

Program 4

The document outlines the development of a web page using Bootstrap 5.0 to demonstrate utility classes for borders, margins, and paddings. It includes HTML code showcasing various padding and margin examples, along with an explanation of Bootstrap's spacing utilities and their responsive behavior. The document details the naming conventions for the utility classes and their respective sizes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views3 pages

Program 4

The document outlines the development of a web page using Bootstrap 5.0 to demonstrate utility classes for borders, margins, and paddings. It includes HTML code showcasing various padding and margin examples, along with an explanation of Bootstrap's spacing utilities and their responsive behavior. The document details the naming conventions for the utility classes and their respective sizes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Program 4: Develop a Web page(s) with suitable HTML elements to demonstrate Bootstrap 5.

0
framework classes for Borders, Margins and Paddings.

<!DOCTYPE html>

<html>

<head>

<link href=

"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"

rel="stylesheet">

</head>

<body>

<div class="container bg-success">

<h1 class="text-secondary mt-5 m-auto">Responsive Web Design</h1>

<h2 class="mt-5"> BootStrap5 Utilities Margin and padding</h2>

<h1 class="text-info mt-5 m-auto">Bootstrap 5.0</h1>

</div>

<div class="container">

<h1 class="text-success mt-5 m-auto">

Bootstrap 5.0 Paddings Demo

</h1>

<div class="pt-0 bg-primary">Padding Top none </div>

<div class="pb-1 bg-warning">Padding Bottom 1</div>

<div class="pl-2 bg-success">Padding Left 4</div>

<div class="pr-3 bg-info">Padding Right 2</div>

<div class="p-5 bg-secondary">Padding All 4</div>

<div class="px-5 bg-secondary">Padding left & right</div>

<div class="py-5 bg-secondary">Padding All top & bottom</div>


</div>

</body>

</html>

<div class="mx-auto" style="width: 200px;">

Centered element

</div>

</html>

Explanation

Spacing
Bootstrap includes a wide range of shorthand responsive margin and padding utility
classes to modify an element’s appearance.

Assign responsive-friendly margin or padding values to an element or a subset of its sides with
shorthand classes. Includes support for individual properties, all properties, and vertical and
horizontal properties. Classes are built from a default Sass map ranging from .25rem to 3rem.

Spacing utilities that apply to all breakpoints, from xs to xl, have no breakpoint abbreviation
in them. This is because those classes are applied from min-width: 0 and up, and thus are not
bound by a media query. The remaining breakpoints, however, do include a breakpoint
abbreviation.

The classes are named using the format {property}{sides}-{size} for xs and {property}{sides}-
{breakpoint}-{size} for sm, md, lg, and xl.

Where property is one of:

 m - for classes that set margin


 p - for classes that set padding
Where sides is one of:

 t - for classes that set margin-top or padding-top


 b - for classes that set margin-bottom or padding-bottom
 l - for classes that set margin-left or padding-left
 r - for classes that set margin-right or padding-right
 x - for classes that set both *-left and *-right
 y - for classes that set both *-top and *-bottom
 blank - for classes that set a margin or padding on all 4 sides of the element

Where size is one of:

 0 - for classes that eliminate the margin or padding by setting it to 0


 1 - (by default) for classes that set the margin or padding to $spacer * .25
 2 - (by default) for classes that set the margin or padding to $spacer * .5
 3 - (by default) for classes that set the margin or padding to $spacer 1.0
 4 - (by default) for classes that set the margin or padding to $spacer * 1.5
 5 - (by default) for classes that set the margin or padding to $spacer * 3
 auto - for classes that set the margin to auto

You might also like