Home Random Page


CATEGORIES:

BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism






What is CSS and their advantage

Definition:Cascading Style Sheets (CSS) and JavaScript Style Sheets used in concert with Scripting is what puts the dynamism in Dynamic HTML.

Description:It allows you to precisely format,embellish, and position the content in your documents instead of acquiescing to the whims of each browser's rendering choices. You can also create documents that change by themselves, or in response to user interaction, and have inline animations contained within

them.

You embellish your content by making stylistic choices that affect the color, size, font face, boldness, and other aspects of text markup, and you can create margins and borders for your text. Then you can position your content exactly where you want it to appear in the page instead of the old inline flow method. Transparent and opaque blocks of content are now possible which you can change, move, resize, make appear or disappear

on-the-fly, or respond to user input. If so inclined, you could let each user custom design how the website will appear for them.

In HTML with Cascading Style Sheets you have to do the coding yourself but you're doing the same thing to your content and you get very similar results. In fact, getting HTML pages to behave more like documents in the publishing world is half the point. The other difference, and this one goes way beyond desktop publishing, is the dynamic and interactive aspects of Cascading Style Sheets.

Example:

When you use the <STYLE> Element, you have to declare with the TYPE Attribute which type of Style Sheet it is, either TYPE="text/CSS"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

<HTML>

<HEAD> <TITLE> Sample 201 - CSS Example 1-1 </TITLE>

<STYLE TYPE="text/CSS">

<!-- H2 { font-size: 14pt; color: aqua; } --> </STYLE> </HEAD> <BODY> <P>

Style Sheet Use:

<H2>This is a level-two heading that is aqua and sized at 14 points.</H2>

Notice that this text which is not inside the H2 tags is rendered with the default

colors of the BODY Tag. </BODY> </HTML>

 

 

17. How does CSS ?
Definition:
Cascading Style Sheets (CSS) and JavaScript Style Sheets used in concert withScripting is what puts the dynamism in Dynamic HTML.

*To create a Cascading Style Sheet, you use CSS syntax to define the parameters of aStyle by first specifying the HTML Element that you want to assign a Style to and then,inside of curly braces{}, you list the ATTRIBUTE NAME and VALUE pair or pairs. Youseparate each NAME and VALUE with a colon like this: NAME:VALUE. Then you separate

{ NAME:VALUE; }

{ NAME:VALUE; NAME:VALUE; NAME:VALUE; }

Here are three different examples of real NAME:VALUE; pairs:

{ color:red; }

{ text-align:left; float:right; }

{ background-color:purple; margin:10pt; border-style:ridge;

 

Putting that all together, here's a simple Style that causes all H2 Element headings to be

displayed with a font that is sized at 14 point and colored aqua:



H2 { font-size:14pt; color:aqua; }

 

each NAME:VALUE; pair with a semicolon, even if there is only one pair, like this: and here is the complete syntax using the STYLE Tags, which are always located in the

HEAD Element:

<HEAD>

<STYLE TYPE="text/CSS">

H2 { font-size: 14pt; color: aqua; }

</STYLE>

</HEAD>

 

 


Date: 2016-01-03; view: 219


<== previous page | next page ==>
URL. Links and their attributes | Color and background in CSS
doclecture.net - lectures - 2014-2017 year. Copyright infringement or personal data (0.007 sec.)