Week 4 Lecture Slides
Week 4 Lecture Slides
Frameworks
DESIGN
Frameworks
RESPONSIVE
Frameworks
DESIGN
Frameworks
• The term “web framework” can mean many things, it depends
upon who you ask.
• Agreement, a framework should make your job easier by
providing code and structure.
RESPONSIVE
Frameworks
DESIGN
Introduction to Bootstrap
RESPONSIVE
Introduction to Bootstrap DESIGN
What is it?
• Framework for creating web sites
• Focuses on responsive, mobile-first approach
• Consists of
○ CSS and HTML templates
○ JavaScript extensions
• Emphasis on interfaces and layouts
RESPONSIVE
Introduction to Bootstrap DESIGN
○ target.com
○ walmart.com
○ codeacademy.com
○ bloomberg.com
○ airbnb
RESPONSIVE
Introduction to Bootstrap DESIGN
Bootstrap benefits
• 12-column grid system
○ Helps with spacing issues
○ Built-in responsive design
• Common jQuery functionalities
○ Accordion, Drop-down menus, Carousel
• Familiar “look and feel”
○ Many sites use Bootstrap
○ Makes your forms look “legitimate”
RESPONSIVE
Introduction to Bootstrap DESIGN
Getting Started
• How do you actually use Bootstrap?
• You need access to the CSS code and JS code.
• Options:
○ Download copy
○ Use absolute reference
○ Link on CodePen
Getting Started With Bootstrap 3 Responsive Design
Using a CDN
• A CDN is a content delivery network
• Provides a way to connect to the Bootstrap code using an
absolute reference
• http://getbootstrap.com/getting-started/
Getting Started With Bootstrap 3 Responsive Design
Template
● It is common to start with a template file.
http://getbootstrap.com/getting-started/#examples
● A modified version from getbootstrap.com can be found here:
RD:Bootstrap Template
Getting Started With Bootstrap 3 Responsive Design
Don’t forget…
• To use element inspector.
• To include the JavaScript at the bottom.
• That you can customize bootstrap defaults.
• That you can overwrite bootstrap defaults.
Getting Started With Bootstrap 3 Responsive Design
Grid classes
• Every grid consists of:
○ A container
■ A row
col-xx-yy
• col-xs-12
• col-sm-8
• col-md-4
• col-lg-3
• These are often combined! Think photos….
<img src = “pic.jpg” class=“col-xs-12 col-sm-6
col-md-3 col-lg-2”>
RESPONSIVE
Bootstrap Grid System
DESIGN
Using Bootstrap
• Using the classes….
Combining elements
• What if you want two elements next to each other, but only
on larger screen?
<div class=“col-xs-12 col-md-3”>Yellow Part</div>
<div class=“col-xs-12 col-md-8”>Orange Part</div>
RESPONSIVE
Bootstrap Grid System
DESIGN
Positioning classes
• On viewports md and up, there is an option for push and pull
class.
○ col-XX-push-YY move YY columns to the right
○ col-XX-pull-YY move YY columns to the left
RESPONSIVE
Bootstrap Grid System
DESIGN
Conclusion
• Bootstrap is mobile first, larger screens inherit values from
smaller screens.
• Review http://getbootstrap.com/examples/grid/
• Do the math!! If you want two elements to be next to each
other on a larger screen, make sure their width adds up to no
more than 12.
RESPONSIVE
Bootstrap Grid System
DESIGN
Bootstrap Navigation
Responsive Design
Bootstrap Navigation
Navigation Bars
• One of the components that gives Bootstrap its familiar “look
and feel” is the navigation options.
• The nav class is combined with other classes to create each
style
Responsive Design
Bootstrap Navigation
Drop downs
• To add dropdown menus you need to include the Bootstrap
js files AND a link to the jQuery.
• Bootstrap
example:http://getbootstrap.com/components/#pills-with-
dropdowns
RD:dropdowns
Responsive Design
Bootstrap Navigation
navbar class
• The navbar class serves as a navigation header
for your application or site.
• Positioning includes:
■ navbar-static-top
■ navbar-fixed-top
■ navbar-fixed-bottom
RD:navbar
Responsive Design
Bootstrap Navigation
Accessibility
• Using a “nav” class does not convey semantics.
• Use the <nav> tag or ARIA attribute role=“navigation”.
Responsive Design
Bootstrap Navigation
Closing
RESPONSIVE
Closing DESIGN
What Else?
● Write rules to facilitate accessibility with motion and color
scheme preferences.
● Discuss the importance of the mobile-first paradigm.
● Understand the grid system of Bootstrap.
RESPONSIVE
Closing DESIGN
What Next?
● More practice until you feel more comfortable.
● Look more into frontend frameworks, eg React, Angular, etc.
● Explore accessibility in more depth.
● Use your knowledge to help elevate existing team projects.
RESPONSIVE
Closing DESIGN
Congratulations!
● You can also take a moment to be proud of yourself.
Great job!
RESPONSIVE
Closing DESIGN