








Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An introduction to various aspects of css and javascript, including shorthand properties, selectors, backgrounds, generic font families, and the javascript interpreter. It covers topics such as shorthand properties like background, font, list-style, margin, border, and padding, as well as different types of selectors like descendant, child, universal, and pseudo-elements. The document also discusses background properties like background-color, background-image, background-repeat, background-attachment, and background-position. Additionally, it covers generic font families like sans-serif, serif, monospace, cursive, and fantasy.
Typology: Assignments
1 / 14
This page cannot be seen from the preview
Don't miss anything!









Descendant selector Override the type and class selector styles Typically with two elements where the second is a descendant li a {font-size: 2em} Example: descendantSelector.html, descendantSelector.css Child selector Element is styled if it is a direct descendant of its parent p > em {text-decoration: underline;} Example: childSelector.html, childSelector.css Universal selector Applies to all elements Example: * {font-family: arial, Helvetica; }
Allows you to style an item that is not marked by elements Two pseudo-elements: :first-letter, and :first-line Example : pseudoElements.html, pseudoElements.css
JavaScript – programming language that can appear in html pages.
It allow us to:
To dynamically create web pages
To control a browser application
Open and create new browser windows
Download and display contents of any URL
To interact with the user
Ability to interact with HTML forms
Process values provided by checkbox, text, buttons, etc.
Example: SqrTable.html
JavaScript
HTML parser – Takes care of processing an html document
JavaScript interpreter – Takes care of processing JavaScript
code
HTML parser – must stop processing an html file when
JavaScript code is found (JavaScript interpreter will then be
running)
This implies a page with JavaScript code that is
computationally intensive can take a long time to load
Execution of JavaScript Programs
JavaScript
Example: JavaScriptTable.html
Illustrates how we can create a table using document.writeln
Notice how we can use Date() to specify a particular date format. Date() is part of JavaScript
The + allow us to concatenate strings
Example: “Mary” + “Land” “MaryLand”
Example: “Time is: “ + new Date()
Notice how we have specified the border size. If you use “ “ the table borders will not be generated. You need to use \”
Keep in mind that this example could have been written without using JavaScript
JavaScript (Output)
Variable – A memory location. In JavaScript variables are declared using var
var temperature;
Variables names must start with a letter, underscore or dollar sign and can be followed by any number of letters, underscores, dollar signs or digits
Variables must be declared before they are used A variable can hold different type of values
Values we can assign to variables
Integer – 0, 10, 40, 6, -
Floating-point – 3.2, .67, 1.48E-
String literals – “hello”, “goodbye”
Operators
Assignment operator (=)
Typical arithmetic operators (+, -, *, /)
Example: Variables.html
JavaScript (Variables)