التخطي إلى المحتوى الرئيسي

What is Bootstrap?,BootStrap Introduction,Bootstrap tutorial for beginners




Bootstrap is an external library that contains .css file and .js file to provide a responsive web layout. responsive means, Layout which is compatible with Mobile Screen, Desktop Screen, TV Screen, Tablet Screen, Projector, etc.
Bootstrap contain set of CSS block which will be called under HTML element. for example, if we want to create two different partitions which is compatible with all device.
How to use bootstrap:
1)first download bootstrap.min.js and bootstrap.min.css I have mentioned download link below with a complete example.
2) Create .html file and link bootstrap .css file and .js file
3) Write the following code to implement bootstrap
class="row" :-  it create responsive row
class="col":-  it create responsive columns
<div class="row">
<div class="col-sm-6">
</div>
<div class="col-sm-6">
</div>
</div>
Complete Code of bootstrap 
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="bootstrap.min.css">

      <script src="bootstrap.min.js"></script>
      <link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="jumbotron text-center">
<h1>Welcome in SHIVA TUTORIALS</h1>
</div>
<div class="container">
<div class="row">
<div class="col-sm-4">
<h3>Column1</h3>
<p>JAVA</p>
<p>dfhgad fhgdhfgsdjhfgsdjhg fjsd gf djhfg dfdg fgdjh fgdjh fgjhad gfhdgfh gdfhgdjhgfdjhgfhadgjhfg djhfg djh fgdh gfhdgfhgdjh fgjhadfgadjh fgd gfhd gfdgjhfg adjh fgjhd gfdh gfhdgfh gdhf gadjh fgjhad gfhadgfhgadjhfg adjhfg adhg fhadg fhad gfhgadjhf gajhfgjha gfasgfh gdjhfgadjh fgasjhgfjhas gas gfjgas jh fgasjh gfasg hadg jhfgd hf gdjh fghd gfhd ghf gdjh fg</p>
</div>
<div class="col-sm-4">
<h3>Column2</h3>
<p>.NET</p>
<p>dfhgad fhgdhfgsdjhfgsdjhg fjsd gf djhfg dfdg fgdjh fgdjh fgjhad gfhdgfh gdfhgdjhgfdjhgfhadgjhfg djhfg djh fgdh gfhdgfhgdjh fgjhadfgadjh fgd gfhd gfdgjhfg adjh fgjhd gfdh gfhdgfh gdhf gadjh fgjhad gfhadgfhgadjhfg adjhfg adhg fhadg fhad gfhgadjhf gajhfgjha gfasgfh gdjhfgadjh fgasjhgfjhas gas gfjgas jh fgasjh gfasg hadg jhfgd hf gdjh fghd gfhd ghf gdjh fg</p>
</div>
<div class="col-sm-4">
<h3>Column3</h3>
<p>PHP</p>
<p>dfhgad fhgdhfgsdjhfgsdjhg fjsd gf djhfg dfdg fgdjh fgdjh fgjhad gfhdgfh gdfhgdjhgfdjhgfhadgjhfg djhfg djh fgdh gfhdgfhgdjh fgjhadfgadjh fgd gfhd gfdgjhfg adjh fgjhd gfdh gfhdgfh gdhf gadjh fgjhad gfhadgfhgadjhfg adjhfg adhg fhadg fhad gfhgadjhf gajhfgjha gfasgfh gdjhfgadjh fgasjhgfjhas gas gfjgas jh fgasjh gfasg hadg jhfgd hf gdjh fghd gfhd ghf gdjh fg</p>
</div>
</div></div>
<div class="jumbotron text-center">
<h1>footer</h1>
</div>
</body>
</html>
For more, you can go

https://github.com/shivaconceptsolution/htmldesign/tree/master/bootstrap
The Bootstrap 4 grid system has five classes:
.col- (extra small devices - screen width less than 576px)
.col-sm- (small devices - screen width equal to or greater than 576px)
.col-md- (medium devices - screen width equal to or greater than 768px)
.col-lg- (large devices - screen width equal to or greater than 992px)
.col-xl- (xlarge devices - screen width equal to or greater than 1200px)
we always prefer sm to define the column width.
<div class="col"></div>
<div class="col-sm-4"></div><div class="col-sm-8">
Text Colors in Bootstrap:-
Bootstrap 4 has some predefined classes that can be used to provide "meaning through colors".
The classes for text colors are: .text-muted, .text-primary, .text-success, .text-info, .text-warning, .text-danger, .text-secondary, .text-white, .text-dark, .text-body (default body color/often black) and .text-light:
<h1 class="text-primary">Why do we use it?</h1>
Background Colors
The classes for background colors are: .bg-primary, .bg-success, .bg-info, .bg-warning, .bg-danger, .bg-secondary, .bg-dark and .bg-light.
<div class="bg-warning"></div> 
when we want to apply more than one class in a single div tag or any HTML  tag.
<div class="col-sm-3 bg-danger text-primary">
............................................................................................................................................................

What is Flex:-
It is special box layout of bootstrap4 which is used to design layout without using the float property.
it provide d-flex class to create a flex layout.
Row-wise:-
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript" src="bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="d-flex flex-column p-3">

<div class="p-2 bg-primary">JAVA</div><div class="p-2 bg-secondary">PYTHON</div><div class="p-2 bg-info">PHP</div></div>
</div>
</body>
</html>
Column-wise flex layout:-

<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript" src="bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div class="d-flex flex-column p-3">

<div class="p-2 bg-primary">JAVA</div><div class="p-2 bg-secondary">PYTHON</div><div class="p-2 bg-info">PHP</div></div>
</div>
</body>
</html>
...............................................................................................................................................

Create a menu using the toggler:-

Bootstrap provide class="navbar" and floowing atrribute

<nav class="navbar navbar-expand-md bg-dark navbar-dark">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
    <span class="navbar-toggler-icon"></span>
  </button>
<div class="collapse navbar-collapse" id="collapsibleNavbar">
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
    </ul>
  </div>
</nav>

......................................................................................

The sequence of BootStrap Plugin:-

1) <meta name="viewport" content="width=device-width, initial-scale=1">
2)  bootstrap.min.css
3)   jquery.min.js
4)   popper.min.js
5)  bootstrap.min.js
We always use the offline files.
How to create a slider in bootstrap:-
to create slider we will use carousal property under div.
Complete code to design slider.
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="bootstrap.min.css">
  <script src="jquery.min.js"></script>
  <script src="popper.min.js"></script>
  <script src="bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="demo" class="carousel slide bg-danger" data-ride="carousel">
  <!-- Indicators -->
  <ul class="carousel-indicators">
    <li data-target="#demo" data-slide-to="0" class="active"></li>
    <li data-target="#demo" data-slide-to="1"></li>
    <li data-target="#demo" data-slide-to="2"></li>
  </ul>
  <!-- The slideshow -->
  <div class="carousel-inner">
    <div class="carousel-item active">
      <img src="1.jpg"  width="800" height="400" alt="Los Angeles">
      <div class="carousel-caption">
    <h3>Los Angeles</h3>
    <p>We had such a great time in LA!</p>
  </div>
    </div>
    <div class="carousel-item">
      <img src="2.png"  width="800" height="400" alt="Chicago">
      <div class="carousel-caption">
    <h3>Los Angeles</h3>
    <p>We had such a great time in LA!</p>
  </div>
    </div>
    <div class="carousel-item">
      <img src="3.jpg" width="800" height="400" alt="New York">
      <div class="carousel-caption">
    <h3>Los Angeles</h3>
    <p>We had such a great time in LA!</p>
  </div>
    </div>
  </div>
  <!-- Left and right controls -->
  <a class="carousel-control-prev" href="#demo" data-slide="prev">
    <span class="carousel-control-prev-icon"></span>
  </a>
  <a class="carousel-control-next" href="#demo" data-slide="next">
    <span class="carousel-control-next-icon"></span>
  </a>
</div>
</body>
</html>

تعليقات

إرسال تعليق

POST Answer of Questions and ASK to Doubt

المشاركات الشائعة من هذه المدونة

Uncontrolled form input in React-JS

  Uncontrolled form input in React-JS? If we want to take input from users without any separate event handling then we can uncontrolled the data binding technique. The uncontrolled input is similar to the traditional HTML form inputs. The DOM itself handles the form data. Here, the HTML elements maintain their own state that will be updated when the input value changes. To write an uncontrolled component, you need to use a ref to get form values from the DOM. In other words, there is no need to write an event handler for every state update. You can use a ref to access the input field value of the form from the DOM. Example of Uncontrolled Form Input:- import React from "react" ; export class Info extends React . Component {     constructor ( props )     {         super ( props );         this . fun = this . fun . bind ( this ); //event method binding         this . input = React . createRef ();...

JSP Page design using Internal CSS

  JSP is used to design the user interface of an application, CSS is used to provide set of properties. Jsp provide proper page template to create user interface of dynamic web application. We can write CSS using three different ways 1)  inline CSS:-   we will write CSS tag under HTML elements <div style="width:200px; height:100px; background-color:green;"></div> 2)  Internal CSS:-  we will write CSS under <style> block. <style type="text/css"> #abc { width:200px;  height:100px;  background-color:green; } </style> <div id="abc"></div> 3) External CSS:-  we will write CSS to create a separate file and link it into HTML Web pages. create a separate file and named it style.css #abc { width:200px;  height:100px;  background-color:green; } go into Jsp page and link style.css <link href="style.css"  type="text/css" rel="stylesheet"   /> <div id="abc"> </div> Exam...

JDBC using JSP and Servlet

JDBC means Java Database Connectivity ,It is intermediates from Application to database. JDBC has different type of divers and provides to communicate from database server. JDBC contain four different type of approach to communicate with Database Type 1:- JDBC-ODBC Driver Type2:- JDBC Vendor specific Type3 :- JDBC Network Specific Type4:- JDBC Client-Server based Driver  or JAVA thin driver:- Mostly we prefer Type 4 type of Driver to communicate with database server. Step for JDBC:- 1  Create Database using MYSQL ,ORACLE ,MS-SQL or any other database 2   Create Table using database server 3   Create Form according to database table 4  Submit Form and get form data into servlet 5  write JDBC Code:-     5.1)   import package    import java.sql.*     5.2)  Add JDBC Driver according to database ide tools     5.3)  call driver in program         ...