Documente Academic
Documente Profesional
Documente Cultură
CSS Syntax
A CSS rule-set consists of a selector and a declaration block:
A CSS declaration always ends with a semicolon, and declaration blocks are
surrounded by curly braces.
In the following example all <p> elements will be center-aligned, with a red
text color:
Example
p {
color: red;
text-align: center;
}
The id Selector
The id selector uses the id attribute of an HTML element to select a specific
element.
To select an element with a specific id, write a hash (#) character, followed by
the id of the element.
The style rule below will be applied to the HTML element with id="para1":
Example
#para1 {
text-align: center;
color: red;
}
To select elements with a specific class, write a period (.) character, followed by
the name of the class.
In the example below, all HTML elements with class="center" will be red and
center-aligned:
Example
.center {
text-align: center;
color: red;
}
Each page must include a reference to the external style sheet file inside the
<link> element. The <link> element goes inside the <head> section:
Example
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>
Internal styles are defined within the <style> element, inside the <head>
section of an HTML page:
Example
<head>
<style>
body {
background-color: linen;
}
h1 {
color: maroon;
}
</style>
</head>
Inline Styles
An inline style may be used to apply a unique style for a single element.
To use inline styles, add the style attribute to the relevant element. The style
attribute can contain any CSS property.
The example below shows how to change the color and the left margin of a
<h1> element:
Example
<h1 style="color:blue;margin-left:30px;">This is a heading</h1>
DOM
The Document Object Model is a programming API for documents. The object model
itself closely resembles the structure of the documents it models.
CGI
The Common Gateway Interface (CGI) is a specification defined by the World Wide Web
Consortium (W3C), defining how a program interacts with a Hyper Text Transfer Protocol
(HTTP) server.
The Common Gateway Interface (CGI) provides the middleware between WWW servers
and external databases and information sources.
CGI applications perform specific information processing, retrieval, and formatting tasks
on behalf of WWW servers.
CGI can do two things:
1. It can gather information sent from the web browser to web server and make the
information available to an external program.
2. CGI can send output of a program to a web browser that request it.
Fig: simple diagram of CGI
As shown in the above figure, a Web browser running on a client machine exchanges
information with a Web server using the Hyper Text Transfer Protocol or HTTP. The Web
server and the CGI program normally run on the same system, on which the web server
resides, Depending on the type of request from the browser, the web server either
provides a document from its own document directory or executes a CGI program.
Advantages:
Web server and language independence.
Wide acceptance.
Simple to use.
Disadvantages:
Each request start up a new process of the CGI.
Stateless protocol.
Communication to supplication must go through the web server.
ActiveX
ActiveX is a set of object-oriented programming technologies and tools
that Microsoft developed for Internet Explorer to facilitate rich media
playback.
Essentially, Internet Explorer uses the ActiveX software framework to
load other applications in the browser.
ActiveX modules are more commonly known as controls or ActiveX
controls. ActiveX controls, which are somewhat similar to Java applets,
extend a browser's functionality.
For example: ActiveX controls were used early on to allow users to play videos and
other multimedia content directly through the browser without having to open a media
player.
Users could also work with ActiveX to view PDF files through the browser or to support
Flash animations.
Common examples of ActiveX controls include:
Command button
List boxes
Dialog boxes.
IE browsers