Week 3 - Forms, RWD, Bootstrap Grid & WCAG
Week 3 - Forms, RWD, Bootstrap Grid & WCAG
• In your Advanced Web Development module next year, you will learn
PHP. However, for now we’re just focusing on learning how to create
forms on the front-end.
• Text fields
• Textarea fields
• Select fields (drop-downs)
• Radio buttons
• Checkboxes
• Submit buttons
• … and many more!
The <form> tag
• Like with tables, HTML forms must be wrapped in <form> … </form>
tags.
• There are two main attributes we can add to the opening form tag
which must be remembered:
• Action – This is the location of the file which will process the data submitted
by the user (i.e. a PHP file)
• Method – This is the type of request the form will make (either POST or GET).
GET vs POST
• By default, if we don’t declare a method attribute on our open <form>
tag the browser will default to processing the form using a GET
request.
• Using GET will add the data submitted by the form to a query string
located in the URL (e.g. index.html?name=bob&age=30)
• Using POST will instead send the data using HTTP headers. Therefore,
the data is passed to the file without modifying the URL.
GET vs POST
• To set a form to submit using GET use the following:
method=“get”
method=“post”
enctype=“multipart/form-data”
• This will allow the form to upload vinary data in the form of files like
images, text documents, pdfs etc…
Responsive Web
Design
Your website's
content should
adapt to meet the
user's
requirements.
Responsive vs Adaptive Design
• Responsive designs use
percentages to fit any screen
size.
• Developed by a team from Twitter (Hence the original name “Twitter Bootstrap”).
• https://get.foundation/
Popular CSS Frameworks – Bulma
• Simple grid system.
• https://bulma.io/
Popular CSS Frameworks – Others
• https://purecss.io/
• https://tailwindcss.com/
• https://getuikit.com/
Which should you use?
• Which you use will depend largely upon the design of the website
you’re creating.
• In most cases, unless you primary focus is mobile (or want to play
with something new and shiny!), you’ll want to make use of
Bootstrap.
• For example, maybe your website integrates Bootstrap but you will never use
it’s tab component…. So, why include it?!
• We wont cover pre-processors in this module, however for now just make
note of this caution when using CSS frameworks.
Grid Systems
What are Grid Systems?
• Grid systems allow us to quickly and concisely organise our content
with a core consideration for mobile design.
<div class=“row”>
</div>
Bootstrap Grid System - Syntax
• We then need to create column elements within…
<div class=“row”>
<div class=“col-md-6”>
This is column 1.
</div>
<div class=“col-md-6”>
This is column 2.
</div>
</div>
Web Accessibility
Usability = Happier users
• What users want vs what they get?
• Learnability of basic tasks
• Efficiency in task performance
• Memorability of using the site
• Errors and recovery
• Satisfaction of UI
• Productivity within website
Website Aesthetics
• For users to have a positive UX - websites must play to cognition of
learning sites through experience and patterns.
• Age
• Location
• Culture
• Hardware and software capabilities (e.g. devices, OS)
• Language barriers
• Disability
But, being “accessible” does include
catering for disabled uses. So, what is a
“disability”?
“… a physical or mental impairment that has a ‘substantial’ and ‘long-
term’ negative effect on your ability to do normal daily activities”
Equality Act (2010)
Disibility and the web
• There are over 10 million disabled people in the UK
• There are over 6.9 million disabled people of working age in the UK
• 19% of the working population
• Not all disabilities affect web usage
• 2 million people are blind or visually impaired
• 1.5 million people in UK have a learning difficulty
Types of disabilities
• Visual Impairment & colour blindness
• Hearing
• Motor - Accident, arthritis, MS, RSI, elderly , etc
• Learning - Dyslexia etc
• Cognitive - Accident, stroke, autism, dementia, Down’s Syndrome, etc
What else?
Search Engines
• Search engines are “users” too!
• Google will view your website in the same way a user does to index it.
• User experience
• See: https://www.w3.org/WAI/standards-guidelines/wcag/glance/
WCAG
• Three levels of compliance:
• Level A – Must be met
• Level AA – Should be met
• Level AAA – May be met (not often achieved)
• https://www.lingscars.com/
• https://www.bbc.co.uk/news
• https://www.visitsuffolk.com/
Colour & text
• Recommended paragraph text size = 12-14px
• “less is more”
Progressive Disclosure Exmple
Visually Impaired Users
• “read more” links
• “skip navigation” links
• Semantic HTML Structure (https://gsnedders.html5.org/outliner/)
• Screen0reader friendly
• Alternative Stylesheets.
Once you have
completed the activities
in a lesson you should
work on your assignment
Activities