The Class Selectors can be defined style rules based on the class attribute of the elements。 All the elements having that class will be formatted according to the defined rule。
Here is an example:
。black { color: #000000; }
The ‘。’ to represent Class selectors。 ‘black’ is the name of the Class。
The ID Selectors can be defined style rules based on the id attribute of the elements。 All the elements having that id will be formatted according to the defined rule。
Here is an example:
#background { color: #000000; }
The ‘#’ to represent ID selectors。 ‘background’ is id name。
1。3JavaScript
1。3JavaScript Overview
JavaScript is a dynamic computer programming language。 It is lightweight and most commonly used as a part of web pages, whose implementations allow a client-side script to interact with the user and make dynamic pages。 It is an interpreted programming language with object-oriented capabilities。
JavaScript was first known as LiveScript, but Netscape changed its name to JavaScript, possibly because of the excitement being generated by Java。 JavaScript made its first appearance in Netscape 2。0 in 1995 with the name LiveScript。 The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers。[4]
The ECMA-262 Specification defined a standard version of the core JavaScript language。
JavaScript is a lightweight, interpreted programming language。
Designed for creating network-centric applications。
Complementary to and integrated with Java。
Complementary to and integrated with HTML。
Open and cross-platform。
JavaScript Syntax
JavaScript can be implemented using JavaScript statements that are placed within the <script>。。。 </script> HTML tags in a web page。
The <script> tags, containing the JavaScript, can be placed anywhere within the web page, but it is normally recommended that it should be kept it within the <head> tags。
The <script> tag alerts the browser program to start interpreting all the text between these tags as a script。 A simple syntax of the JavaScript will appear as follows。
< script language="javascript" type="text/javascript" JavaScript code </script>
The script tag takes two important attributes:
Language: This attribute specifies what scripting language you are using。Typically, its value will be javascript。 Although recent versions of HTML(and XHTML, its successor) have phased out the use of this attribute。
Type: This attribute is what is now recommended to indicate the scripting language in use and its value should be set to "text/javascript"。