Bootstrap L. Grewe.

Slides:



Advertisements
Similar presentations
Twitter Bootstrap. Agenda What is it? Grids and Fluid layouts Globals and Typography Tables, Forms and Buttons Navigation Media and thumbnails Responsive.
Advertisements

Bootstrap & CSS James Kahng. Intro Websites require a lot of upfront setup to look passably good (HTML base, CSS style, etc.) Because of this, people.
Twitter Bootstrap Paul Frederickson. Tonight’s Objectives Learn how to set up a bootstrap based site Become familiar with bootstrap syntax Create a framework.
Use CSS to Implement a Reusable Design Selecting a Dreamweaver CSS Starter Layout is the easiest way to create a page with a CSS layout You can access.
SE-2840 Dr. Mark L. Hornick1 Bootstrap A framework for CSS.
Bootstrap by:- Vignesh Dhamodaran. What is Bootstrap? Originally created by a designer and a developer at Twitter. So initial name is Twitter Bootstrap.
 An HTML, CSS, Javascript framework you can use as a basis for creating web sites  Uses CSS settings, fundamental HTML elements styled and enhanced.
A gentle introduction to Bootstrap MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/18/
Fundamentals of Web DevelopmentRandy Connolly and Ricardo Hoar Textbook to be published by Pearson Ed in early Bootstrap.
INTRODUCTION ABOUT DIV Most websites have put their content in multiple columns. Multiple columns are created by using or elements. The div element is.
A gentle introduction to Bootstrap TDAP Jeremy Shafer Department of MIS Fox School of Business Temple University Spring
Week 1: Introduction to HTML and Web Design
Front-end framework 1.
HTML HTML5 InfoTech Seminar.
Web Development & Design Foundations with HTML5
INTRO TO WEB DEVELOPMENT html
Bootstrap KS Technologies.
CNIT131 Internet Basics & Beginning HTML
Cookies, Sessions, Bootstrap
SOEN 287 Web programming Tutorial 03- HTML5 & CSS
Bootstrap 3 SoftUni Team Technical Trainers Software University
PHP MySQL Crash Course with HTML CSS
Twitter Bootstrap Grid System
A gentle introduction to Bootstrap
CSS Bootstrap.
A better approach to mobile
Website implementation
Front-End Framework for Responsive Web Sites
Human Computer Interaction
Web Development & Design Foundations with HTML5
Web Programming– UFCFB Bootstrap Lecture 12
DHTML tidbits.
User Interface Design and Usability Bootstrap
CS3220 Web and Internet Programming Introduction to Bootstrap
IS1500: Introduction to Web Development
CSCI 1720 Intermediate Web Design
Bootstrap響應式網頁設計 (Responsive Web Design, RWD)
CSS part 2 Outro.
Chapter 8 More on Links, Layout, and Mobile Key Concepts
Web System & Technology
Revision.
APTECH JANAKPURI INSTITUTE PROVIDING WEB DESIGNING COURSES Address:- J-1,2nd Floor, Opp Metro Pillar No – 559, Janakpuri East, Delhi /42.
Bootstrap Topics What is bootstrap? Documentation
Responsive Web Design (RWD)
DHTML tidbits.
A gentle introduction to Bootstrap
Responsive Web Design (RWD)
Anatomy of an App User Interface Design
Responsive Web Design and Bootstrap
Intro to Web Development Links
Basics of Web Design Chapter 8 More on Links, Layout, and Mobile Key Concepts Copyright © 2014 Terry Ann Morris, Ed.D.
DHTML tidbits.
Responsive Grid Layout with Bootstrap
Responsive Web Design (RWD)
Chapter 2 Bootstrap Grid System
Chapter 7 Absolute/relative hyperlinks Frag id 3-column site
CSS and Bootstrap MIS 2402 Jeremy Shafer Department of MIS
CSS and Bootstrap MIS 3502 Jeremy Shafer Department of MIS
Responsive Web Design and Bootstrap
Sending a text message (and more)
CS3220 Web and Internet Programming Introduction to Bootstrap
Computer communications
Web Page Layout Imran Rashid CTO at ManiWeber Technologies.
Web Client Side Technologies Raneem Qaddoura
Web Development & Design Foundations with HTML5
Web Client Side Technologies Raneem Qaddoura
Bootstrap Direct quote from source: bootstrap/
Multiple Columns By Derek Peacock
Bootstrap/WebFlow Web development of the future
Web Programming and Design
Presentation transcript:

Bootstrap L. Grewe

What is it? api/framework developed by Twitter for mobile first, responsive (to changing devices it is displayed on) web sites/applications. (api of CSS, and javascript extensions) And - HTML and CSS based design templates for typography, forms, buttons, tables, navigation, modals, image carousels and many other, as well as optional JavaScript plugins

You can develop on command line or Webstorm If you don’t use the Webstorm IDE you have to go through the steps of downloading bootstrap and manually setting up (see appendix B of the Getting MEAN book) We are using Webstorm and setup for it can be found on our webpage

Webstorm option 1: create a bootstrap project Create new bootstrap project Will create series of static files that are delivered to client(e.g. browser) and not run on server (NodeJS)

Option 1: more on bootstrap project Now your files that use bootstrap like my html file here called homepage.html must include the appropriate files Here is an index.html page I created <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>HomePage using Bootstrap</title> <link rel="stylesheet" href="../css/bootstrap.css"> <script src="../js/bootstrap.min.js"></script> </head> <body> <div class="container"> <div class="row"> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 1</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 2</p></div> <div class="clearfix visible-sm-block"></div>

Option 2: existing project –add links to external CDN server PROS: if you already have an existing Webstorm project (like a NodeJS project) and want to add Bootstrap to it --this is the easiest as you don't have to download any code. NEGATIVES: possible a little more time to download to a client (browser) as your code coming from different server than CDN GO TO http://getbootstrap.com/docs/4.0/getting-started/download/ to get the latest code!!!!!!!!!!!!!!!! <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous"> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>

Option 3: install manually bootstrap code download Bootstrap files and add to existing project manually and do like #option 1 In terminal window of WebStorm ide of project type: (or whatever version you want) npm install bootstrap@4.0.0-beta <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>HomePage using Bootstrap</title> <link rel="stylesheet" href="../css/bootstrap.css"> <script src="../js/bootstrap.min.js"></script> </head> <body> <div class="container"> <div class="row"> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 1</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 2</p></div> <div class="clearfix visible-sm-block"></div>

What is Bootstrap – lets start with 12 grid structure Bootstrap RESPONSIVENESS – through use of column span based on Device dimensions Each “row” has up to 12 columns You can specify how many columns any item spans RESPONSIVE = Bootstrap will rearrange the columns depending on size of the screen

How do you specify column span with class specification on item and you specify column span for a device size First, lets define sizes of devices Example class = “col-sm-6” Means span up to 6 columns –thus 12/6 =2 items / row”

Simple Bootstrap html example NOTE: you can add bootstrap in HTML, EJS, Jade/Pug and other interface scripting languages that support Javascript Here is the start of the file (continue next page)….. <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Example of Bootstrap 3 Multi-Column Grid Layout for All Devices</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body>

<div class="container"> <div class="row"> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 1</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 2</p></div> <div class="clearfix visible-sm-block"></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 3</p></div> <div class="clearfix visible-md-block"></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 4</p></div> <div class="clearfix visible-lg-block"></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 5</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 6</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 7</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 8</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 9</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 10</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 11</p></div> <div class="col-sm-6 col-md-4 col-lg-3"><p>Box 12</p></div> </div> Sm devices have span 6 columns, md has span 4, large has span of 3  will clear “row” for sm devices  will clear “row” for md devices  will clear “row” for lg devices

results Depending on device number of items / “row” alters as expected

What is the <div class=“container”> Bootstrap requires a containing element to wrap site contents and house our grid system. 2 CHOICES: <div class="container"> ... </div> Use .container for a responsive fixed width container. <div class="container-fluid"> ... </div> Use .container-fluid for a full width container, spanning the entire width of your viewport. Bootstrap RESPONSIVENESS – fit width of viewport

For more info about Bootstrap defined css classes…. Go to https://getbootstrap.com/docs/3.3/css/

jade + Bootstrap example: and one row with xs column span of 12 (so this 1 item is in its own row) doctype html html head meta(name='viewport', content='width=device-width, initial- scale=1.0') title= title link(rel='stylesheet', href='/bootstrap/css/amelia.bootstrap.css') link(rel='stylesheet', href='/stylesheets/style.css') body block content script(src='/javascripts/jquery-1.11.1.min.js') script(src='/bootstrap/js/bootstrap.min.js') body .row .col-xs-12 small © Simon Holmes 2014

Another HTML based Bootcamp example <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>CS3520</title> <!-- Bootstrap --> <link href="../CSS/bootstrap.css" rel="stylesheet"> <link href="../CSS/Highlight_Styles.css" rel="stylesheet" type="text/css"> <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --> <!-- WARNING: Respond.js doesn't work if you view the page via file:// --> <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> </head> Bootstrap that says make the width of the viewport THIS is the RESPONSIVE part

continued <body style="padding-top: 70px"> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --> <script src="../JS/jquery-1.11.3.min.js"></script> <!-- Include all compiled plugins (below), or include individual files as needed --> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container-fluid"> <!-- Brand and toggle get grouped for better mobile display --> <div class="btn-link"> <button type="button" class="navbar-toggle collapsed" data- toggle="collapse" data-target="#topFixedNavbar1" aria-expanded="false"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="../index.html">CS 3520</a> <span class="navbar-brand2 hidden-xs"> Web Site Development </span> </div> Bootstrap says make this div tag fluid to width of device

continued Bootstrap --- navbar-collapse – depending on device will collapse navigaton <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="topFixedNavbar1"> <ul class="nav navbar-nav"> <li><a href="../outline.htm">Outline<span class="sr-only">(current)</span></a></li> <li><a href="../work.html">Work</a></li> <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">More<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="../syllabus.htm">Syllabus</a></li> <li role="separator" class="divider"></li> <li>< href="../links.htm">Links</a></li> <li><a href="../instructor.htm">Instructor</a></li> </ul> </li> </div> <!-- /.navbar-collapse --> <!-- /.container-fluid --> </nav> Bootstrap --- navbar-collapse, dropdown-toggle, etc. Read online to find out what each of these do

NEXT- Assignment You need to (ASSIGNED) go to W3 schools website on Bootstrap https://www.w3schools.com/bootstrap/bootstrap_get_started.a sp AND GO OVER: 1) getting started 2) grid basics 3) spend 20 minutes more browsing the site to learn about Bootstrap NOTE: we have concentrated on the CSS part of Bootstrap –you can specifically learn about the Bootsrap Javascript extensions at https://getbootstrap.com/docs/3.3/javascript/ SPEND 20 minutes browsing