Bootstrap (1)
Bootstrap (1)
It
provides a set of pre-designed components and a responsive grid system to help you create flexible and
adaptive web designs.
Here are the fundamentals of implementing responsive web design with Bootstrap:
To start using Bootstrap, you can either download the framework or link to a Content Delivery Network
(CDN)
Bootstrap's grid system uses a series of containers, rows, and columns to layout and align content. It's
built with flexbox and is fully responsive2. Here's an example:
Bootstrap provides utility classes to help you manage visibility, spacing, and alignment of elements based
on screen size. For example:
<div class="d-none d-md-block">This text is hidden on small screens but visible on medium and larger
screens.
4. Responsive Components
Bootstrap includes a variety of responsive components such as navigation bars, modals, carousels, and
more. Here's an example of a responsive navbar:
You can customize Bootstrap by overriding its default styles using custom CSS or by using Sass variables.
This allows you to tailor the framework to match your design requirements.
6. JavaScript Plugins
Bootstrap includes JavaScript plugins for interactive components like modals, tooltips, and carousels.
Make sure to include the necessary JavaScript files to enable these features:
Balsamiq mockup:
Using Balsamiq to mockup and wireframe websites is a great way to visualize your design ideas quickly
and efficiently. Here's how you can integrate Balsamiq with Bootstrap to create wireframes for your
responsive web design:
First, create a new project in Balsamiq Mockups. You can start with a blank canvas or use one of
Balsamiq's templates2.
Use Balsamiq's drag-and-drop interface to design your wireframes. You can add UI elements like buttons,
text fields, and images to represent the different components of your website3. Focus on the layout and
functionality rather than the visual design.
While designing your wireframes, think about how you will implement Bootstrap components in your
final design. For example, you can use placeholders for Bootstrap's grid system, navigation bars, modals,
and other responsive elements.
In your wireframes, you can represent the Bootstrap grid system using placeholders. For example, you
can use rectangles to represent columns and rows2. This will help you visualize how your content will be
laid out on different screen sizes.
5. Add Annotations
Balsamiq allows you to add notes and annotations to your wireframes. Use this feature to explain how
certain elements will be implemented using Bootstrap. For example, you can add a note next to a
placeholder column indicating that it will be a Bootstrap col-md-4 column.
Balsamiq offers collaboration features like comments and shared projects. Use these features to get
feedback from your team and ensure everyone is on the same page regarding the implementation of
Bootstrap components.
Once your wireframes are complete, you can export them as images or PDFs to share with your team.
This will help everyone understand the design and how it will be implemented using Bootstrap.
By following these steps, you can effectively use Balsamiq to mockup and wireframe your responsive
web design projects, ensuring a smooth transition from wireframes to the final implementation with
Bootstrap.
UI design:
2.Consistency
Whether it's the color, typography, buttons, or locations, keep it the same.
3. Feedback
Giving the users feedback is vital to help them go in the right direction and keep using your product.
4. Predictability
Predictability means designing the interface so that the user knows the forecast of the following action.
5. Learnability
you can create an interface that allows the users to move around and get to their desired actions
without needing assistance in any way.
Its grid supports six responsive breakpoints. You can control container, column sizing and
behavior by each breakpoint.
Containers center and horizontally pad your content. Use container class for responsive width
and container-fluid class for 100% width across all viewports and devices. Use container-
md class for both fluid and pixel width.
Rows are wrappers for columns. Each column has horizontal padding (called a gutter) for
controlling the space between them.
Columns are incredibly flexible. There are 12 template columns available per row, allowing you
to create different combinations of elements that span any number of columns.
Gutters are also responsive with customizable available across all breakpoints. We can change
horizontal gutters with .gx-* and vertical gutters with .gy-*
Grid options: Bootstrap’s grid system works for all six breakpoints i.e xs, sm, md, lg, xl, xxl.
Auto-layout columns: This provides the creation of easy column sizes without an explicit numbered class.
Responsive classes: They provide predefined classes for building complex responsive, dynamic, and
flexible layouts.
Nesting: We need to add a new row and set of columns for nesting which includes a set of columns that
add up to 12 or fewer.
Sass: This system also provides Sass variables and mixins to create custom and responsive page layouts.
Customizing the grid: This is used to customize your grid as you want by using built-in grid Sass variables
and map.
<html>
<head>
<link rel="stylesheet"
href=
"https://stackpath.bootstrapcdn.com/bootstrap/5.0.0-alpha1/css/bootstrap.min.css"
crossorigin="anonymous">
</head>
<body class="m-2">
<section class="container">
<section class="row">
GFG Column 1
</section>
GFG Column 2
</section>
GFG Column 3
</section>
</section>
<br>
<section class="row">
<section class="col border bg-warning">
GFG Column 1
</section>
GFG Column 2
</section>
GFG Column 3
</section>
</section>
</section>
</body>
</html>
Default Container: This is the most simple one with all the basic necessities. The default
Container is a responsive container and has a fixed width for every breakpoint or screen size
like small, medium, large, and so on.
Fluid containers: This is used to utilize the whole space that is provided to the container. The
Fluid Container is a container that occupies all the space available from one end to the other end
for every breakpoint or screen size like small, medium, large, and so on.
Responsive Container: This is used to set a custom responsive container. The Responsive
Container is the one that becomes a container after specifying the specific breakpoint or screen
size like sm, md, lg, xl and xxl. Before hitting that breakpoint size which is specified it acts as
a Fluid container.
Sass: It has a set of predefined container classes which makes building layouts easier. We can
customize it by changing the Sass map.
Syntax:
<div class="Container-class">
// Content
</div>
<!doctype html>
<html lang="en">
<head>
<link href=
"https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet">
<script src=
"https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js">
</script>
</head>
<body>
Nitra
</h1>
navbar-light bg-light">
<a class="navbar-brand"
href="#">
</a>
</nav>
</div>
navbar-light bg-light">
<a class="navbar-brand"
href="#">
</a>
</nav>
</div>
</body>
</html>
Bootstrap Buttons
To achieve the button styles above, Bootstrap has the following classes:
.btn
.btn-default
.btn-primary
.btn-success
.btn-info
.btn-warning
.btn-danger
.btn-link
The following example shows the code for the different button styles:
Example
Example
.btn-lg
.btn-sm
.btn-xs
The following example shows the code for different button sizes:
Example
Example
The class .active makes a button appear pressed, and the class .disabled makes a button unclickable:
Example
<button type="button" class="btn btn-primary active">Active Primary</button>
<button type="button" class="btn btn-primary disabled">Disabled Primary</button>
Icons play an important role in our modern applications. If we use good icons in our website then it can
attract the user's attention and also help the user to identify which purpose it is used for.
Prerequisites
HTML
CSS
First, you need to add the Font Awesome stylesheet to your HTML file. This can be done by including the
following CDN link in the <head> section of your HTML document.
Next, create a container in your HTML where you will display the icons. You can use a <div> or any other
appropriate HTML element.
To make your icons visually appealing, you can apply some CSS styles. Below is an example of how to
style the icons and their container.
Once you’ve set up the HTML and CSS, open your HTML file in a web browser to see the icons displayed.
Ensure that the icons are visible, properly aligned, and styled according to your preferences.
Example: The example code below shows how to use font awesome icons in HTML.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
"width=device-width, initial-scale=1.0">
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
</head>
<body>
<div class="container">
<header>
</header>
<section class="icon-demo">
<div class="icon-row">
<div class="icon-card">
<p>Home</p>
</div>
<div class="icon-card">
<p>User</p>
</div>
<div class="icon-card">
<p>Email</p>
</div>
<div class="icon-card">
<p>Settings</p>
</div>
<div class="icon-card">
<p>Twitter</p>
</div>
</div>
</section>
<footer>
</footer>
</div>
</body>
</html>
CSS:
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
background-color: #f5f7fa;
color: #333;
padding: 40px;
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
header {
margin-bottom: 40px;
}
header h1 {
font-size: 2.8rem;
color: #2be459;
text-transform: uppercase;
letter-spacing: 2px;
font-weight: 700;
margin-bottom: 10px;
}
.icon-demo {
background-color: #ffffff;
padding: 40px;
border-radius: 12px;
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
margin: 0 auto;
text-align: center;
}
.icon-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 25px;
justify-items: center;
margin-top: 30px;
}
.icon-card {
background-color: #f0f2f5;
padding: 30px;
border-radius: 10px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
text-align: center;
cursor: pointer;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
width: 150px;
}
.icon-card:hover {
transform: translateY(-10px);
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}
.icon-card i {
font-size: 3.5rem;
transition: color 0.3s ease;
}
.icon-card i.fa-home {
color: #ff6347;
}
.icon-card i.fa-user {
color: #4caf50;
}
.icon-card i.fa-envelope {
color: #007bff;
}
.icon-card i.fa-cog {
color: #ff9800;
}
.icon-card i.fa-twitter {
color: #1da1f2;
}
.icon-card p {
margin-top: 15px;
font-size: 1.1rem;
color: #333;
font-weight: 500;
}
footer {
background-color: #2c3e50;
color: #ffffff;
padding: 20px;
margin-top: 50px;
text-align: center;
border-radius: 10px;
}
footer p {
font-size: 1rem;
margin: 0;
}
.icon-card:hover {
cursor: pointer;
}
header h1 {
font-size: 2.2rem;
}
}
<div class="item">
<img src="chicago.jpg" alt="Chicago">
</div>
<div class="item">
<img src="ny.jpg" alt="New York">
</div>
</div>