Chapter 2.3 CSS & JS
Chapter 2.3 CSS & JS
com
CSS
• CSS stands for Cascading Style Sheets.
• CSS describes how HTML elements are to be displayed on screen, paper,
or in other media.
• CSS saves a lot of work. It can control the layout of multiple web pages all
at once.
• External stylesheets are stored in CSS files.
Demonstration
2
External, Internal and Inline CSS
• In external:
– Each page must include a reference to the external style sheet file
(.css) inside the <link> element.
– The <link> element goes inside the <head> section.
• In internal:
– Internal styles are defined within the <style> element, inside the
<head> section of an HTML page.
• In inline:
– To use inline styles, add the style attribute to the relevant element.
– The style attribute can contain any CSS property.
Demonstration
3
CSS Examples
• how to create a dropdown navigation bar.
Demonstration.
• create hoverable side navigation buttons with CSS.
Demonstration.
• create icon bars with CSS.
Demonstration.
• create a responsive sign up form with CSS.
Demonstration.
4
JS
• JavaScript is one of the 3 languages all web
developers must learn:
1. HTML to define the content of web pages
Demonstration
5
Internal and External JS.
• Interna: JavaScript code must be inserted
between <script> and </script> tags anywhere
in the html page.
• External: Scripts can also be placed in external
files (.js).
Demonstration
6
JS Examples
• Animating with JavaScript.
Demonstration
• create a responsive slideshow with JavaScript.
Demonstration
• Create Modals(a dialog box/popup window
that is displayed on top of the current page).
Demonstration