Practical 5
Practical 5
Bootstrap has gained widespread adoption in the web development community due
to its ease of use, flexibility, and ability to speed up the development process.
Whether you are a beginner or an experienced developer, Bootstrap can be a valuable
tool for creating modern and responsive web applications.
Bootstrap 5 Installation:
Using a Content Delivery Network (CDN) link for Bootstrap is a convenient way to
include the Bootstrap framework in your web project. Bootstrap is a popular front-
end framework that simplifies the process of designing responsive and visually
appealing web pages. Here's how you can use a CDN link for Bootstrap:
Include the CDN Link in Your HTML File:
Add the CDN Link tag in the <head> section of your HTML file to include the
Bootstrap CSS file
Make sure to replace 5.0.2 with the version you want to use. You can find the latest
version on the Bootstrap website or the chosen CDN provider's documentation.
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-
EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin="anonymous">
</head>
<body>
<a href="#" class="btn btn-primary">Button</a>
</body>
</html>
Output:
Advantages of using a CDN link:
By using a CDN link, you benefit from faster loading times because users can
potentially retrieve the Bootstrap files from a server geographically closer to them.
Additionally, it reduces the burden on your web server.
By using CDN links, you ensure that your web page is always using the latest version
of Bootstrap without having to download and host the files yourself. Keep in mind
that using a CDN requires an internet connection for your users to load the Bootstrap
files.
1. Offline Availability:
When you use the compiled CSS file offline, your web application can still function even
without an internet connection. This is crucial for scenarios where users may not always
have access to the internet, such as in offline applications or on local development
environments.
3. Improved Performance:
Local hosting of the compiled CSS file can result in improved performance since the file is
retrieved from the local file system. This reduces the need for network requests, leading to
faster rendering of styles and improved user experience.
5. Version Control:
Hosting the compiled CSS file locally facilitates version control. You have control over which
version of Bootstrap you are using, and updates can be managed intentionally. This ensures
consistency in styling across your application, and you won't inadvertently be affected by
updates to external CDNs.
While there are advantages to using the compiled CSS file offline, it's essential to consider
trade-offs, such as the manual effort required to update Bootstrap versions and potential
increases in file size when compared to using a CDN. Ultimately, the choice between local
hosting and using a CDN depends on your project's specific requirements and constraints.
Tailwind and CSS based web development
Vue JS: Directives and Binding
React JS: Elements, UI Components, JSX, Redux, Fetch Data
and Asynchronous Programming, GraphQL APIs