Академический Документы
Профессиональный Документы
Культура Документы
Links
Relative Links
Do not use protocol or domain name For files within the same file system Start at the location of the current URL
Absolute Links
Local: Start at root with a / Remote: include protocol & domain name Generally, this is the best practice/standard
Use Dreamweaver to
Create relative links Create absolute links Create an email link Link from an image Image map Insert image Use image placeholders
target attribute
Generally, this is used for frames, but it can be used to avoid frames _blank, _parent, _top, _self, are the default target attributes (note the underscores) In-page links (aka bookmark, target)
<a name=whatever /> W3C recommends eliminating the name attribute in favor of the id attribute Since any element can have an id, <a> can simply be used for hyperlinks
Images
Bitmap images
JPG, GIF, PNG These are reproductions of images
Vector graphics
Flash, Fireworks Instructions to create images
Favicons
The favicon is show in the address bar 16x16 pixel icon (special image type) Must exist as favicon.ico in the root Must include the following in the <head>
Graphics Modification
Transparency
Index transparency
Supported by GIF and PNG Pick one color and it becomes transparent Issues with Halos due to dithering; the remaining gradient in the transition zone remains
Alpha transparency
Each pixel, regardless of color has a transparency index from 0 (opaque) to 255 (completely transparent) PNG only
Colors
Dithering: Creating the illusion of more color by creating patterns with existing colors Palette: Available colors
32-bit color: 232 = 4.3 billion colors 24-bit color: 216 = 16.7 million colors 8-bit color: 28 = 256 colors Web safe colors reduce 256 to 216
00 33 66 99 CC FF
Hexidecimal
Base 10 1
We use hex for colors because base 16 is a round number for binary, and FF = 255 (8-bit, 256 #s)
Binar y 1 Hex 1 Base Binary 10 11 1011 Hex B Base 10 21 Binar y Hex Base 10 31 Binary 11111 100001 100010 100011 Hex 1F 21 22 23 10101 15
2
3 4 5
10
11 100 101
2
3 4 5
12
13 14 15
1100
1101 1110 1111 10001 10010 10011 10100
C
D E F 11 12 13 14
22
23 24 25
10110 16
10111 17 11000 18 11001 19
32
33 34 35
100000 20
6
7 8 9 10
110
111 1000 1001 1010
6
7 8 9 A
16
17 18 19 20
10000 10
26
27 28 29 30
11010 1A
11011 1B 11100 1C 11101 1D 11110 1E
36
37 38 39 40
100100
100101 100110 100111 101000
24
25 26 27 28
By name
Red, Green Blue
Triplet Pairs
#ff0000, #00ff00, #0000ff
Short form
f00, 0f0, 00f
Allows you to pick background colors and background images, as well as other page-wide settings
Background Images
Should be flat in color depth (i.e. all relatively brown, or blue, or whatever) Should have low contrast (i.e. difference in brightness is minimal) Avoid background images with transparent areas
Tiled
A single image repeated in a tiling pattern
Margin
A thin, wide image that is repeated on top of itself, resulting in a pattern with distinct areas as you go left to right (be careful with the widths)
Watermark
A single image {background-repeat:no-repeat}
Background tip
If using a background image, still apply a background color Some users have images off, so if you have a dark background image, use a dark background color in case the image is not rendered.
a:link a:visited a:active (works for all elements such as input boxes in some browsers) a:hover (works for all elements in some browsers)
DHTML
What is DHTML
DHTML is Dynamic HTML DHTML = HTML + CSS + a scripting language (usually Javascript) Allows you to change content on the web page without a full page reload
Saves network traffic Saves user wait time Prevents screen jumping
position:relative
Moves an element relative to its original position, had there been no positioning
position:absolute
Puts an element in an exact location, as specified by other CSS attributes
Visibility
visibility:visible Visibility:hidden
left:
specifies the elements left position
top:
specifies the elements top position
z-index:
specifies whether an element is on top of or behind other elements. Done by rank with 0 being the default (-/+ values allowed)
Use document.getElementById
Dont need to worry about the hierarchy
Changing an element
Pick a state from the state dropdown. Javascript calls the server to get list of counties The server returns a list and the county dropdown is populated from this list.