The complete HTML & CSS. A static "screenshot" of what your app will look like.
Code requirements:
Working as a group:
They are relative sizes calculated
Thing B = 50 x .5 = 25px
Thing C = 40 x 1 = 40px
Index.html
style.css
- How much commenting should we do in the code?
- How many lines of code should phase 1 include?
- Can we use bootstrap?
- Do I have to implement the topic I chose from the proposal?
- When to use class vs ids vs tags
- What is @media and how do we use it?
- For our projects do we design for smaller screens?
Get the starter code from the starter branch, but do all of your work on main.
# switch to starter branch to get new starter code
git checkout starter
# download new starter code
git pull
# switch back to main branch for coding
git checkout main
# merge in new starter code (use default msg)
git merge starter --no-edit
# code and enjoy!
<head>
<!--... other elements here...-->
<!-- link Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
rel="stylesheet" >
<!-- link own stylesheets AFTER framework -->
<link rel="stylesheet" href="css/my-style.css">
</head>
minified CSS file!
Non Minified version
<head>
<!-- link Bootstrap -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
rel="stylesheet" >
<!-- link own stylesheets AFTER framework -->
<link rel="stylesheet" href="css/my-style.css">
</head>
Before
After
Bootstrap provides rules that apply to particular classes. Give an element that class in order to style it in a certain way.
margin top of 0
margin side of 1
padding on left and right of 2
padding of 3
Levels of size range from 0 to 5
Buttons, Cards, Carousel, Dropdowns, Navbar, Spinners, etc...
Button example
Example:
Syntax
The media queries effect screen widths with the given breakpoint or larger.
We tend to write the responsive utility classes left to right:
<div class =d-none d-sm-block d-md-none">
Within the HTML brackets '<' '>' the order doesn't matter. Bootstrap has the media query ordered in the CSS file smallest to largest.
Make sure to put link your stylesheet further down in the html file than bootstrap to override bootstrap classes
row
row
column
column
column
There are 12 columns in the grid
Elements can take up many columns
Row 1:
Row 2:
Row 3:
Specify columns based on screen-size
Smaller screen display
A Row:
Bootstrap provides interactive "widgets" you can use without writing JavaScript code, by using specific HTML attributes.
https://getbootstrap.com/docs/5.3/getting-started/introduction/
<!-- include Bootstrap library (before your script!) -->
<!-- copy script tag from the Bootstrap home page -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" </script>
As a simple example, you can make an element "collapsable" so that it disappears with a button click!
<button class="btn btn-primary"
data-bs-toggle="collapse"
data-bs-target="#collapseExample"
aria-expanded="false" aria-controls="collapseExample">
Button with data-bs-target
</button>
<div class="collapse" id="collapseExample">
Some placeholder content for the collapse component. This panel is
hidden by default but revealed when the user clicks the toggler.
</div>
aria for screen-readers
See https://getbootstrap.com/docs/5.3/components/navbar/ for an example of a NavBar with a collapsible "hamburger menu"
Read: through Chapter 10
Now is a good time to catch up!
Problem Set 04 due Friday
Next: JavaScript!!