. <style type="text/css">. .
:
<html><head> <title> </title></head><style type="text/css">h1{color:red; font-style:italic; font-size:32px}.blue{color:blue}#bold{font-weight:bold}</style><body><h1> </h1> <font class="blue"> </font> - , a <font id="bold"> </font> - .</body></html>h1 , blue , id="bold" . <style type="text/css"> <style>, .
. , , .
:
styles.css
<style type="text/css">body {background:black; font-size:9pt; color:red; font-family:Arial Black}.base{color:blue; font-style:italic}h1 {color:white}#bold {font-weight:bold}</style>HTML <link>. : <link rel="stylesheet" type="text/css" href=" ">
:
Index.html
<html><head><title> </title></head><link rel="stylesheet" type="text/css" href="styles.css"><body> </body></html>CSS
CSS , , .
(, ..), (padding), (border) (margin). CSS .
13, , [4].
13. CSS
color | Css- color |
background | Css- background |
background-attachment | Css- background-attachment , |
background-color | Css- background-color |
background-image | Css- background-image , |
background-position | css- background-position |
background-position-x | css- background-position-x . |
background-position-y | css- background-position-y |
background-repeat | Css- background-repeat |
layer-background-color | Css- layer-background-color Netscape Navigator 4.x. |
layer-background-image | Css- layer-background-image Netscape Navigator 4.x. |
-moz-opacity | Css- -moz-opacity Netscape Navigator 6.x . |
font | Css- font : font-style, font-variant, font-weight, font-size, line-height font-family |
font-family | css- font-family |
font-size | Css- font-size |
font-size-adjust | Css- font-size-adjust x |
font-stretch | Css- font-stretch |
font-style | css- font-style |
font-variant | Css- font-variant |
font-weight | Css- font-weight |
letter-spacing | Css- letter-spacing |
line-height | Css- line-height |
text-align | Css- text-align , |
text-align-last | Css- text-align-last |
text-decoration | Css- text-decoration , |
text-indent | Css- text-indent |
text-overflow | Css- text-overflow |
text-transform | Css- text-transform |
vertical-align | Css- vertical-align |
white-space | Css- white-space |
word-spacing | Css- word-spacing |
word-wrap | Css- word-wrap , |
writing-mode | Css- writing-mode |
list-style | Css- list-style list-style-type, list-style-image list-style-position |
list-style-image | Css- list-style-image , |
list-style-position | Css- list-style-position |
list-style-type | Css- list-style-type |
border-collapse | Css- border-collapse |
border-spacing | Css- border-spacing . |
caption-side | Css- caption-side . |
empty-cells | Css- empty-cell . |
table-layout | Css- table-layout . |
margin | Css- margin |
margin-bottom | Css- margin-bottom |
margin-left | Css- margin-left |
margin-right | Css- margin-right |
margin-top | Css- margin-top |
padding | Css- padding |
padding-bottom | Css- padding-bottom |
padding-left | Css- padding-left |
padding-right | Css- padding-right |
padding-top | Css- padding-top |
border | Css- border , , |
border-bottom | Css- border-bottom , |
border-bottom-color | Css- border-bottom-color |
border-bottom-style | Css- border-bottom-style |
border-bottom-width | Css- border-bottom-width |
border-left | Css- border-left , |
border-left-color | Css- border-left-color |
border-left-style | Css- border-left-style |
border-left-width | Css- border-left-width |
border-right | Css- border-left , |
border-right-color | Css- border-right-color |
border-right-style | Css- border-right-style |
border-right-width | Css- border-right-width |
border-top | Css- border-left , |
border-top-color | Css- border-top-color |
border-top-style | Css- border-top-style |
border-top-width | Css- border-top-width |
border-style | Css- border-style |
border-color | Css- border-color |
border-width | Css- border-width |
- | |
clear | Css- clear (float) |
float | Css- float |
display | Css- display , |
overflow | Css- overflow , . |
overflow-x | Css- overflow-x , . |
overflow-y | Css- overflow-y , . |
position | Css- position , . |
z-index | Css- z-index . |
bottom | Css- bottom . |
left | Css- left |
right | Css- right . |
top | Css- top |
width | Css- width |
height | Css- height |
min-width | Css- min-width |
max-width | Css- man-width |
min-height | Css- min-height |
max-height | Css- man-height |
scrollbar | |
scrollbar-3dlight-color | Css- scrollbar-3dlight-color . |
scrollbar-arrow-color | Css- scrollbar-arrow-color |
scrollbar-base-color | Css- scrollbar-base-color , . |
scrollbar-darkshadow-color | Css- scrollbar-darkshadow-color |
scrollbar-face-color | Css- scrollbar-face-color |
scrollbar-highlight-color | Css- scrollbar-highlight-color |
scrollbar-shadow-color | Css- scrollbar-shadow-color |
scrollbar-track-color | Css- scrollbar-track-color |
behavior | Css- behavior dhtml- |
cursor | Css- cursor , |
zoom | Css- zoom |
accelerator | Css- accelerator , |
|
|
|
|
|
|
: "+" ( ) "-" [] [ ] ( )
:
-566pt: ex - x-height, "x"
px - pixels,
in - inches,
cm - centimeters,
mm - millimeters,
pt - points, (1pt = 1/72in)
|
|
pc - picas (1pc = 12pt)
: "+" "-" [] "%" ( )
:
-566%
: [color]
:
magenta(red, lightgreen, coral ..) RGB
RGB (red green blue):
#rrggbb (, #00cc00)
rgb(x,x,x) -- "" 0 255 (, rgb(0,204,0))
#rgb (, #0c0)
rgb (x%,x%,x%) -- "%" 0.0 100.0 (, 0%,80%,0%)
: "URL", . , , ( )
:
URL('cool.gif')
HTML-, 2, , , .
6 2.
1. ?
2. ?
3. ?
4. ?
5. ?
6. ?
8
: JavaScript. . (8 )
: JavaScript HTML-.
JavaScript - . , , , . JavaScript , , C, Pascal . , . , - , - , -. var, . , . , , , var , , - . :
:
var a; // var b = 10; // b var = "Hello, world."; // [5].. , , , .
:
document.write("Can't open document");// : Can't open documentdocument.write(' ""');// : ""document.write('Can't open document');// ! Can, .. document.write(" """);// ! ,JavaScript , . , , . , . =. :
a = 10; // a 10b = a + 5; // b 15c = a + (b = a + b); // b 25, 35 .. (b = a + b) , , 25. . (+), (-), (*), (/) (%).
=. .
a += 10; // a = a + 10;a -= 10; // a = a - 10;a *= 10; // a = a * 10;a /= 10; // a = a / 10;a %= 10; // a = a % 10;(+) . - , , . , .
a = b = c = d = 5; // d 5, (5) c, - b, , , - a. .. 5. 14 .
|
|
14.
- 0 | |
"" | - |
"0" | - |
"1 > 100" | - |
1 > 100 | - , 100? |
23 > 3 | - , ! |
"23" > "3" | - "23" , "3" |
(1 > 100) || "" | - , , , , .. |
(a!= 5) || (a!= 10) | a! , 5 10 a ! |
(a < 5) && (a > 10) | a! ! |
1. ++ --. . , . , .
:
var b=2;a = b++; // a 2, b 1a = ++b; // b 1 ( 4), (4) aa = a+b--; // 8, b 1, C, :
(< >)? 1: 21, 2, .
:
a = (b>c)? b: c; // a b ca = ((b>c)? b: c)+1; // a b c 1a = (b % 2)? "": "";if
if (< >) 1; [else 2;]. , 1. , 2 ( ). , if.
, , , , . "" .
:
if (a>b) document.write(" B");else document.write(" B");if (day==1) document.write("");else if (day==2) document.write("");else if (day==3) document.write("");else if (day==4) document.write("");else if (day==5) document.write("");else if (day==6) document.write("");else if (day==7) document.write("");else document.write(": day="+day);while
while (< >) ;. , . . - .
, . , , , , .
:
var i = 0;while (i10 , , , 10.
:
var i = 0;while (i>10) { document.write("*"); i = i+1;}document.write(i);, .. (i>10) . 0.
:
var i = 0;while (i, .. . , i 10.
for
for (1;2;3) ;:
1. 1
2. 2
3. 2 ( , , ) , .
4. 3
5. 2
, for while.
1;while (2) { ; 3 }, 1 , . 2 . , , 3 , 2 .
( ) for . , . . .
:
// 10 for (var i=0; ifor (var i=1; ifor (var i=100; i<=200; i+=2) document.write(i);// 2 4096for (var i=2; i<=4096; i*=2) document.write(i); MathJavaScript . - Math.
0-1, random Math. :
var a = Math.random(); // a 0 1, , .
, 0.4 , 0.2 .
var a = Math.random(); // a 0 1 if (a < 0.4) document.write("");else if (a < 0.8) document.write("");else document.write(" ");: