Professional Documents
Culture Documents
https://drive.google.com/file/d/1G6kotTOWr1MSRvFJyDy_6L_3BT4CJu9b/view?
usp=share_link
WWW History
Tim Berners Lee - inventor, used to work at CERN (switzerland)
HYPERTEXT - document containing text that links to another document.
Result of HYPERTEXT:
1. HTML
display pages
SPOTIFY (2017)
UNDERWATER CABLES
500,000,000 MI of CABLE
Optical Fibers
WebAppDev 1
SESSION START
|| ACTUAL START ||
HTML (Hypertext Markup Language)
NOT a PL!
PURELY VISUAL
WebAppDev 2
Meta Tags (placed inside <head>)
Most common tags:
LINKS
<a> link tag
<a href="http://www.google.com> search </a> link another page
<a href="#top"> top </a> link to a section w/in same page
<a href="http://www.google.com target="_blank"> search </a> open new tab
<a href="page2.html"> tae </a>
IMAGES
Local image:
<img src=”/img/sample.jpg” alt=”sample text” width=”400”>
Remote Images:
WebAppDev 3
<img src=” https://source.unsplash.com/400x400/?nature,water ” alt=”Daily Inspiration”>
SESSION ENDED
. . . . . . . . . . .
SESSION STARTED
Lists
WebAppDev 4
Tables
<table>
<thead>
<tr>
<th>Name</th>
<th>Age</th>
</tr>
</thead>
<tbody>
<tr>
<td>Angelo</td>
<td>20</td>
</tr>
<tr>
<td>Angeli</td>
<td>23</td>
</tr>
<tr>
<td>Angela</td>
<td>16</td>
</tr>
</tbody>
</table>
2. Textarea
3. Select
4. Submit
<form action="">
<input type="email" placeholder="email"> <br>
WebAppDev 5
<input type="url" placeholder="url"><br>
<br>
<input type="submit">
</form>
Semantic Tags
put everything inside DIVs
<header>
<footer>
<nav>
<main>
<section>
<article>
<aside>
WebAppDev 6
Introduction to: CSS
Cascading Style Sheets
Implementing CSS
Three ways to implement CSS
1. Inline
2. Internal CSS
3. External CSS
CSS Comment
/* COMMENT */
a {
background-color: yellow;
WebAppDev 7
}
Basic Selectors
. class = ."className"
# ID = #"idName"
LIVE DEBUGGING! (edit on the browser and see effect immediately) local to our
machine only
Fonts in CSS
Web safe fonts
preloaded on all major browsers
font-family: Arial, Helvitica, sans-serif
DEFAULT FONTs
Times New Roman and Sans-Serif
WebAppDev 8
Adding new fonts
fonts.google.com
Font Size
Default is 16px
font-size: __px
line-height: 1.6em
Text Alignment
The properties are left , right , center , and justify .
Color Types
h1 {
color: red;
}
h1 {
color: rgb(255, 0, 0);
}
h1 {
color:#ff0000; // or #fff
}
WebAppDev 9
✅ Useful Websites for color-color
www.color-hex.com
https://htmlcolorcodes.com
https://flatuicolors.com/
Borders
Shorthand
border: “border-width” “border-style” (required) “border-color”
Area
border-top , border-right , border-bottom , border-left
Rounded Corners
border-radius: top-left, top-right, bottom-right, bottom-left CLOCKWISE*
Backgrounds
The background property is a shorthand property for:
background-color
background-image
background-position
background-size
background-repeat
background-origin
background-clip
background-attachment
body {
background-image: url("paper.gif");
background-color: #cccccc;
}
WebAppDev 10
.hero-image {
background-image: url("photographer.jpg"); /* The image used */
background-repeat: no-repeat; /* Do not repeat the image */
background-position: center top; /* Center the image. Can also use numbers - 100px 100px */
background-size: cover; /* Resize the background image to cover the entire container */
}
SHORTHAND
.hero-image {
background: url("photographer.jpg") no-repeat center center/cover
}
body {
background-image: url("img_tree.gif");
background-repeat: no-repeat;
background-attachment: fixed;
}
Box Model
The CSS box model is a container.
including borders, margin, padding, and the content itself
WebAppDev 11
Margin
margin: "top", "right", "bottom", "left"
or
margin-top: , margin-right: , margin-bottom: , margin-left:
Padding
padding: "top", "right", "bottom", "left"
or
padding-top: , padding-right: , padding-bottom: , padding-left:
Size Calculation
2 * Border + 2 * Padding + Content = Total BOX SIZE
Box Sizing
The box-sizing property defines how the width and height of an element are
calculated.
box-sizing: border-box
Margin Collapse
topand bottom margins are combine (collapsed) into a single margin ng MAS MALAKI
sa kanila (or same margin lang kung equal.)
* {
margin: 0;
padding: 0;
}
Positioning
WebAppDev 12
position: static, relative, absolute, fixed, or sticky
static - default
absolute - relative to its PARENT
fixed - relative to BROWSER WINDOW
relative - relative to its NORMAL/ORIGINAL Position
sticky - based on the user’s SCROLL Position
Floating
used to position and align images and text
.div2 {
border: 1px solid red;
clear: both;
}
Floating Elements
The float property takes the element out of the document flow
Absolutely positioned elements ignore the float property
✅ Floating a content will make the parent unable to see, and it will collapse the
height
WebAppDev 13
Link Style and Button Style
Different states:
Link
Visited
Hover
Active
Button Making
<ul class="navbar">
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact</a></li>
</ul>
CSS
.navbar {
list-style: none;
margin: 0;
padding: 0;
background-color: #4c6ca0;
border-radius: 5px;
overflow: auto; /* This resolves the collapsing content because of float */
}
WebAppDev 14
Navigation Styling (Sidemenu)
WebAppDev 15
Introduction to Responsive Design
RESPONSIVE LAYOUT
>It is a necessity to build responsive layouts
>Layouts should render on any form factor
MEDIA QUERIES
Each device has a different size and resolution.
Small devices (portrait tablets and large phones, 600px and up)
@media only screen and (min-width: 600px) {...}
WebAppDev 16
Rem ( root em )
, a unit of measurement that represents the font size of the root element.
Using rem can help ensure consistency of font size and spacing throughout your UI.
Em
relative to the font size of their parent element, not the root element
Vh & Vw Units
Viewport - the whole area inside the browser
You can set the content to take up width and height relative to the current viewport.
div {
background: #333;
color: #fff;
height: 100vh;
}
landing-page {
background: url(https://source.unsplash.com/daily) no-repeat center center/cover;
height: 100vh;
}
<input type=”email”>
<input type=”tel”>
<input type=”password”>
<input type=”time”>
<input type=”url”>
<input type=”search”>
<input type=”hidden”>
WebAppDev 17
<input type=”file”>
<input type=”range”>
TARGETED SELECTORS
New Selectors
Example:
<a href=”#”>page 1</a>
<a href=”#” target=”__blank”>page 1</a>
We can use the following as selector - a[target] {}
:nth-child selectors
1. Direct number
/* Selects the second element of div siblings */
div:nth-child(2) {
WebAppDev 18
background : red;
}
2. Odd or Even
p:nth-child(odd) {
background : red;
}
Syntax:
.container::before{
content: '';
background: url(image file);
position:absolute;
top:0px;
left:0px;
opacity: 0.9; // Make the image transparent. Optional but nice effect
Z-index: -1 // push the image behind
}
Lets get use the following image to test
https://source.unsplash.com/1600x900/?nature,water
WebAppDev 19
z-index
.box1 {
positon: relative;
top: 10px;
left: 10px;
}
.box2 {
Z-index: 100; // this is any number
}
GRADIENTS
-css element of the image data type that show a transition between two or more
colors
GRADIENTS BUTTONS
WebAppDev 20
text-decoration: none;
}
BOX SHADOW
TEXT SHADOWS
Basic syntax:
h1 {
text-shadow: 2px 2px #ff0000;
}
CSS VARIABLES
To make the variable available to the entire page use the :root scope
KEYFRAME ANIMATION
Animation:
When you specify CSS styles inside the @keyframes rule, the animation will gradually
change from the current style to the new style at certain times.
To get an animation to work, you must bind the animation to an element.
WebAppDev 21
Example:
/* The animation code /
@keyframes example {
from {width: 100px}
to { width: 600px;}
}
/ The element to apply the animation to */
div {
width: 100px;
height: 100px;
background-color: red;
animation-name: example;
animation-duration: 4s;
}
WebAppDev 22