Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
CSS Means: Full form of CSS is Cascading Style Sheets Styles define how to display HTML elements Styles are normally stored in Style Sheets Styles were added to HTML 4
...
They were supposed to say "This is a header", "This is a paragraph", "This is a table", by using tags like
,
,
, and so on
...
As the two major browsers - Netscape and Internet Explorer - continued to add new HTML tags and attributes (like the tag and the color attribute) to the original HTML specification, it became more and more
difficult to create Web sites where the content of HTML documents was clearly separated from the document's presentation layout
...
0
...
CSS Can Save a Lot of Work: Styles sheets define HOW HTML elements are to be displayed, just like the font tag and the color attribute it HTML 3
...
Styles are normally saved in external
...
External style sheets enable you to change the appearance and layout of all the pages in your Web, just by editing one single CSS document! CSS is a breakthrough in Web design because it allows developers to control the style and layout of multiple Web pages all at once
...
To make a global change, simply change the style, and all elements in the Web are updated automatically
...
Styles can be specified inside a single HTML element, inside the element of an HTML page, or in an external CSS file
...
What style will be used when there is more than one style specified for an HTML element? Generally speaking we can say that all the styles will "cascade" into a new "virtual" style sheet by the following rules, where number four has the highest priority: 1
...
External style sheet 3
...
Inline style (inside an HTML element) Syntax is:
tags
...
tags
...
The CSS syntax is made up of 3 parts: a selector, a property and a value
...
The property and value are separated by a colon and surrounded by curly braces: body {color: black} If the value is multiple words, put quotes around the value: p {font-family: "sans serif”} If you wish to specify more than one property, you must separate each property with a semi-colon
...
Separate each selector with a comma
...
All header elements will be green: H1,H2,H3,H4,H5,H6 { color: green }
2) Types of Style sheet:-
Method to Insert Style Sheet: When a browser reads a style sheet, it will format the document according to it
...
- With an external style sheet, you can change the look of an entire Web site by changing one file
...
- The tag goes inside the head section:
This is a paragraph with center align
...
o You can also omit the tag name in the selector to define a style that will be used by all HTML elements that have a certain class
...
center {text-align: center} In the code below both the h1 element and the p element have class="center"
...
center" selector:
This heading will be center-aligned
This paragraph will also be center-aligned
...
o The style rule below will match any element that has an id attribute with a value of "green": #green {color: green} The rule above will match both the h1 and the p element:
Some text data
p#para 1 { text-align: center;
color: red } o The style rule below will match any p element that has an id attribute with a value of "green": p#green {color: green} o The rule above will not match an hl element:
Some text data
Comments in CSS: You can insert comments into CSS to explain your code, which can help you when you edit the source code at a later date
...
A CSS comment begins with “/*”, and end with “*/”, like this: /* This is a comment */ p { text-align: right; /* This is comment
...
Font-family property: The font-property is a prioritized list of font family names and/or generic family names for an element
...
Separate each value with a comma
...
Example: body { font-family: courier, serif} p { font-family: arial, “lucida console”, sans-serif}
Font-style property: o The font-style property sets the style of a font
...
Value Normal Bold Bolder Lighter 100 to 900
Description Defines normal characters Defines thick characters Defines thicker characters Defines lighter characters Defines from thin to thick characters
...
Example: P {font-weight: bold} o
Font-size property: The font-size property sets the size of a font
...
It sets the font-size to smaller size than the parent element
...
It sets the font-size to a fixed size
...
Example: Body {font-size: x-large} P {font-size: 10px} o
Font-variant property: The font-variant property is used to display text in a small-caps font, which means that all the lower case letters are converted to uppercase letters, but all the letters in the small-caps font have a smaller font-size compared to the rest of the text
...
It displays small-caps font
...
It is possible to change the color of a text, increase or decrease the space between characters in a text, align a text, decorate a text, indent the first line in a text, and more
...
Value Color
Description The color value can be a color name(red), a rgb value (rgb(255,0,0)), or a hex number(#ff0000)
...
Value Left Right Center Justify
Description It aligns the text to the left
...
It Centers the text
...
Examples: p { text-align: center } Text-decoration property - The text-decoration property decorates the text
...
Value
Description Defines normal text, with lower case letters and capital letters Each word in a text starts with a capital letter Defines only capital letters Defines no capital letters, only lower case letters
None Capitalize Uppercase Lowercase
Example: P { text-transform: uppercase
}
Word-spacing property - The word-spacing property increases or decreases the white space between words
...
Value Normal Length
Description Defines normal space between words
...
Example: P { word-spacing:30px } p { word-spacing: -0
...
-
Negative values are allowed
...
Length
Defines a fixed space between characters
...
10px
}
6) CSS Background Property: CSS Background Properties: The CSS background properties allow you to control the background color of an element, set an image as the background, repeat a background image vertically or horizontally, and position an image on a page
...
Value Color
Transparent Example: p { -
Description The color value can be a color name (red), a rgb value (rgb(255,0,0)), or a hex number (#ff0000) The background color is transparent
background-color: #00ff00 }
Background-image property The background-image property sets an image as the background
...
Value
Description
url None
The path to an image No background image Example: Body { background-image: url(stars
...
Value
Description The background image will be repeated vertically and horizontally The background image will be repeated horizontally The background image will be repeated vertically The background image will be displayed only once
Repeat Repeat-x Repeat-y No-repeat
Example: body { background-image: url(stars
...
Value Scroll Fixed
Description The background image moves when the rest of the page scrolls The background image does not move when the rest of the page scrolls
...
gif); background-attachment: scroll } -
Background-position property The background-position property sets the starting position of a background image
...
The first value is the horizontal position and the second value is the vertical
...
The right bottom corner is 100% 100%
...
The first value is the horizontal position and the second value is the vertical
...
Units can be pixels(0px 0px) or any other CSS units
...
You can mix % and positions
...
gif); background-repeat: no-repeat; background-position: top left }
7) CSS Border Property: CSS Border Properties: The CSS border properties allow you to specify the style and color of an element's border
...
Border-style property - The border-style property sets the style of the 4 borders, can have from 1 to 4 styles
...
Renders as solid in most browsers Defines a dashed border
...
The width of the two borders are the same as the border-width value Defines a 3D grooved border
...
The effect depends on the border-color value Defines a 3D inset border
...
The effect depends on the border-color value Example: Table { border-style: dotted dashed solid double }
The top border will be dotted, right border will be dashed, bottom border will be solid, left border will be double
...
This property can one to four colors
...
An element must have borders before you change the color of them
...
The border is transparent
...
Value Thin Medium Thick Length
Description Defines a thin border
...
Defines a thick border
...
Example: table {border-width: thin} All four borders will be thin table {border-width: thin medium thick none} Top border will be thin, right border will be medium, bottom border will be thick- left side will have no border Border-top-width property - The border-top-width property sets the width of an element's top border
...
Defines a medium top border
...
Allow you to define the thickness of the top borders
...
5cm } Border-bottom-width - The border-bottom-width sets the width of an element’s bottom border
...
Example: table { border-bottom-width: thin } Border-left-width property - The border-left- width property sets the width of an element's left border
...
Example: table { border-left-width: thin } Border-right-width property - The border-right-width property sets the width of an element's right border
...
Value Border-top-width Border-style Border-color
Description Sets the properties for the top border
...
Value : Same to border-top property
...
- This property can not set a different value for each side of the border, like "margin" and "padding"
...
border-style border-color Example: P { border: thin dotted #00FF00 }
8) CSS List Property: CSS List Properties: The CSS list properties allow you to place the list-item marker, change between different list-item markers, or set an image as the list-item marker
...
- Some browsers only support the “disc” value
...
) The marker is lower-roman (i, ii, iii, iv, v, etc
...
) The marker is lower-alpha (a, b, c, d, e, etc
...
) The marker is lower-greek (alpha, beta, gamma, etc
...
Value Inside Outside
Description Indents the marker and the text
...
- Always specify a "list-style-type" property in case the image is unavailable
...
gif); list-style-type: circle } o List-style property - The list-style property is a shorthand property for setting all the properties for a list in one declaration
...
Negative values are not allowed
...
A shorthand padding property is also created to control multiple sides at once
...
- Negative values are not allowed
...
- Negative values are not allowed
...
- Negative values are not allowed
...
The values comes in % (defines padding in % of the width of the closest element) and length (defines a fixed padding)
...
It is possible to use negative values to overlap content
...
A shorthand margin property can also be used to change all of the margins at once
...
Opera does not! Instead, Opera applies a default padding of 8px, so if one wants to adjust the margin for an entire page and have it display correctly in Opera, the body padding must be set as well! ^ margin-top Property ^ margin-bottom Property ^ margin-left Property ^ margin-right Property ^ margin Property o Margin-top property - The margin-top property sets the top margin of an element
...
Value
Description
Auto Length %
The browser sets a top margin Defines a fixed top margin Defines a top margin in % of the total height of the document Example: Hl { h2 {
margin-top: 10px margin-top: -20px
} }
o Margin-bottom property, margin-left property, margin-right property - The margin-bottom property, margin-left property & margin-right property sets the bottom margin, left margin & right margin of an element respectively
...
Value : Same to margin-top property Example: hl { h2 {
o Margin property - The margin property is a shorthand property for setting all of the properties for the four margins in one declaration
...
Value margin-top margin-right margin-bottom margin-left
Description Sets the properties for the margins
...
Example: h1 { margin: 10px } all four margins will be 10px hl { margin: 10px 2% } top and bottom margin will be 10px, left and right margin will be 2% of the total width of the document
...
h1 { margin: 10px 2% -10px auto} top margin will be 10px, right margin will be 2% of the total width of the document, bottom margin will be -10px, left margin will be set by the browser
...
Marks-20
Introduction to JavaScript
JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies, and much more
...
What is JavaScript?
JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means that scripts execute without preliminary compilation) Everyone can use JavaScript without purchasing a license Are Java and JavaScript the Same?
NO! Java and JavaScript are two completely different languages in both concept and design! Java (developed by Sun Microsystems) is a powerful and much more complex programming language - in the same category as C and C++
...
write("
" + name + "
") can write a variable text into an HTML page JavaScript can react to events - A JavaScript can be set to execute when something happens, like when a page has finished loading or when a user clicks on an HTML element JavaScript can read and write HTML elements - A JavaScript can read and change the content of an HTML element JavaScript can be used to validate data - A JavaScript can be used to validate form data before it is submitted to a server
...