CS1520: Programming Languages for Web Application Development
Lecture 08: Logging & Debugging / CSS
Learning Objectives
Logging and Debugging
To See What's Happening Right Now...
gcloud app logs tail
Logging and Debugging
Since you won't be able to always be there watching, logging allows you to store information and errors for later review.
You can use standard Python logging:
import logging� logging.info('Some informational message.')� logging.warn('Some message you want to warn about.')
https://console.cloud.google.com/logs/viewer to view logs.
You Can Also Enable Cloud Logging
See: https://github.com/timothyrjames/gae-webdev/tree/main/step07
Now instead of stdout / stderr you will need to select 'app' in the Cloud Logging interface, but you'll get status codes.
See https://cloud.google.com/logging/docs/setup/python for more information.
Cascading Style Sheets
Cascading Style Sheets (CSS)
CSS is used for formatting of your page.
Selectors & declarations. Selectors based on:
These can be combined.
Can be shared by using commas.
Cascading Style Sheets (CSS) Selectors
footer {
font-style: italic;
font-size: 8pt;
}
#highlight {
border-color: #ff0000;
}
.bluesection {
background-color: darkblue;
color: white;
}
element selector
class selector
id selector
Cascading Style Sheets (CSS) Selectors
Selectors can be combined:
Cascading Style Sheets (CSS) Selectors
Keep it simple - "universal" application of CSS properties will lead to conflicts and unexpected behaviors.
Cascading Style Sheets
Can be used:
Cascading Style Sheet
<head>
<title>HTML samples</title>
<style>
body {
font-family: Arial;
font-size: 10pt;
}
</style>
</head>
<head>
<title>HTML samples</title>
<link rel="stylesheet" href="style.css">
</head>
<section style="font-weight: bold; font-size: 1.25rem;">
This is an HTML file, and it is full of links to samples.
</section>
external CSS file
style HTML element
style attribute in HTML
CSS Fonts
font-family:
font-style:
font-weight:
font-size:
CSS Link States
link:
visited
active
hover
CSS Colors
Declarations:
Can use hex codes, rgb values, or color names.
CSS Colors (Names)
moccasin
navajowhite
navy
oldlace
olive
olivedrab
orange
orangered
orchid
palegoldenrod
palegreen
paleturquoise
palevioletred
papayawhip
peachpuff
peru
pink
plum
powderblue
purple
red
rosybrown
royalblue
saddlebrown
salmon
lightpink
lightsalmon
lightseagreen
lightskyblue
lightslategray
lightslategrey
lightsteelblue
lightyellow
lime
limegreen
linen
magenta
maroon
mediumaquamarine
mediumblue
mediumorchid
mediumpurple
mediumseagreen
mediumslateblue
mediumspringgreen
mediumturquoise
mediumvioletred
midnightblue
mintcream
mistyrose
gainsboro
ghostwhite
gold
goldenrod
gray
green
greenyellow
grey
honeydew
hotpink
indianred
indigo
ivory
khaki
lavender
lavenderblush
lawngreen
lemonchiffon
lightblue
lightcoral
lightcyan
lightgoldenrodyellow
lightgray
lightgreen
lightgrey
darkgreen
darkgrey
darkkhaki
darkmagenta
darkolivegreen
darkorange
darkorchid
darkred
darksalmon
darkseagreen
darkslateblue
darkslategray
darkslategrey
darkslategrey
darkturquoise
darkviolet
deeppink
deepskyblue
dimgray
dimgrey
dodgerblue
firebrick
floralwhite
forestgreen
fuchsia
aliceblue
antiquewhite
aqua
aquamarine
azure
beige
bisque
black
blanchedalmond
blue
blueviolet
brown
burlywood
cadetblue
chartreuse
chocolate
coral
cornflowerblue
cornsilk
crimson
cyan
darkblue
darkcyan
darkgoldenrod
darkgray
silver
gray
white
maroon
red
purple
fuchsia
green
lime
olive
yellow
navy
blue
teal
aqua
sandybrown
seagreen
seashell
sienna
silver
skyblue
slateblue
slategray
slategrey
snow
springgreen
steelblue
tan
teal
thistle
tomato
turquoise
violet
wheat
white
whitesmoke
yellow
yellowgreen
CSS Background
images:
repeat:
CSS Box
margin / border / padding all have left / right / bottom / top declarations.
The following border declarations are commonly used:
CSS Borders
border-style
border-color
border-width
border-radius
CSS Visibility and Positioning
HTML has "block" elements: start a new line and take up 100% width.
HTML also has "inline" elements: appear in normal text flow.
Can be changed with:
"none" hides the element completely; to hide with its space:
CSS Flex
Requires "container" and elements
flex-direction: column | row
flex-wrap: wrap | nowrap
justify-content: center | flex-start | flex-end
CSS Visibility and Positioning
position: static | relative | fixed | absolute
Other CSS Properties
outline (outside border):
float: left | right
text-align:
text-decoration:
opacity:
text-transform:
text-shadow:
list-style-type:
CSS Examples in Practice
Questions?
| |
| |
| |
| |
| |