.fireplace {
border-right: 0;
}
.archway {
display: flex;
justify-content: flex-end;
align-items: flex-end;
}
CSS IRL
From: reddit.com/r/css_irl/
By the end of this lecture, you should be able to:
What would be the flexbox rules necessary to accomplish this with our boxes.html example? (Box 5 is at the top, 0 at the bottom)
Layout boxes into two 3-box columns using flex.
First: How would you change the HTML slightly as well to get the columns grouped?
#boxes-container
was changed to 500px#box-container.
How many flex containers do you think are on this example website?
Description of the game
Demo of the website
Logistics
Important: To accept and submit for both submissions you will:
Background
Last term we collected student names and groups on note cards like we did earlier
We were afraid of losing the cards so we wrote the Randomizer (demo).
A student mentioned after the class was over that the group they sat with on Day 2 never sat together again, so random group call ... wasn't effective
A Wireframe* diagram of your site is a very low fidelty sketch of what you think your website will look like
The idea is not to worry about colors or even filling in any text, you want to get a feel for what the site will look like overall (proportions and locations of key elements) and how it will function.
Recall: Students must be able to enter a group name and some number of students
<form>
<form>
s are a way to group objects that allow users to
input information into a web page to add interactivity.
<form>
<input type="text" size="10" maxlength="8" /> Your name <br />
<input type="text" size="16" /> Your favorite color <br />
<input type="number" size="4" min=0 /> The airspeed wing velocity of a swallow
<button type="submit" value="submit" />Submit<button>
</form>
HTML
output
The following is a (partial) list of HTML form elements (with examples in the slides below). For more information on form elements, make sure to check MDN.
<button>
Performs an action, usually submitting data or resetting a form to the original values.
<button id="my-btn">Click me!</button>
HTML
output
Button's text appears inside tag; can also contain images
We will learn how to make a button responsive in Module 2
<input>
<!-- 'q' happens to be the
name of Google's required parameter -->
<input type="text" name="q" value="Colbert Report" />
<input type="submit" value="Booyah!" />
HTML
Input element is used to create many UI controls (an inline element that must be self-closed
name
attribute specifies name of query parameter to pass to server
type
can be button
, checkbox
, file
, hidden
, password
, radio
, reset
, submit
, text
, ...
value
attribute specifies control's initial text
<input> Text Fields
<input type="text" size="10" maxlength="8" /> NetID <br />
<input type="password" size="16" /> Password
<input type="submit" value="Log In!" />
HTML
output
input
attributes: disabled
, maxLength
, readonly
, size
, value
size
attribute controls onscreen width of text field
maxlength
limits how many characters the user is able to type into the field
<textarea>
<textarea rows="4" cols="20">
Type your comments here.
</textarea>
HTML
output
Initial text is placed inside textarea
tag (optional)
Required rows
and cols
attributes specify height/width in characters
optional readonly
attribute means text cannot be modified
<input>
yes/no choices that can be checked and unchecked (inline)
<input type="checkbox" name="lettuce" /> Lettuce
<input type="checkbox" name="tomato" checked="checked" /> Tomato
<input type="checkbox" name="pickles" checked="checked" /> Pickles
HTML
output
None, 1, or many checkboxes can be checked at same time
Use checked="checked"
attribute in HTML to initially check the box
<input>
sets of mutually exclusive choices (inline)
<input type="radio" name="cc" value="visa" checked="checked" /> Visa
<input type="radio" name="cc" value="mastercard"/> MasterCard
<input type="radio" name="cc" value="amex"/> American Express
HTML
output
Grouped by name attribute (only one can be checked at a time)
Must specify a value for each one or else it will be sent as value on
<label>
<label>
<input type="radio" name="cc" value="visa" checked="checked" /> Visa
</label>
<label>
<input type="radio" name="cc" value="mastercard"/> MasterCard
<label>
<input type="radio" name="cc" value="amex"/> American Express
</label>
HTML
Grouped by name attribute (only one can be checked at a time)
Must specify a value for each one or else it will be sent as value on
<select>
,
<option>
menus of choices that collapse and expand (inline)
<select name="favorite-character">
<option>Rob</option>
<option>John</option>
<option selected="selected">Ayra</option>
<option>Sansa</option>
</select>
HTML
output
Option element represents each choice
Select optional attributes: disabled, multiple, size
Optional selected attribute sets which one is initially chosen
<select name="favorite-character[]" size="3" multiple="multiple">
<option>Rob</option>
<option>John</option>
<option selected="selected">Ayra</option>
<option>Sansa</option>
</select>
HTML
output
Optional multiple attribute allows selecting multiple items with shift- or ctrl-click
Must declare parameter's name with []
if you allow multiple selections
Option tags can be set to be initially selected
<select name="favorite-character">
<optgroup label="Major Characters">
<option>John</option>
<option selected="selected">Ayra</option>
</optgroup>
<optgroup label="Minor Characters">
<option>Rob</option>
<option>Sansa</option>
</optgroup>
</select>
HTML
output
What should we do if we don't like the bold appearance of the optgroups?
Starting with
groupizer.html
(and the given groupizer.css
)
and the form elements on the previous slides, let's build the form.