mc0064 august 2010 q & ans

Upload: abhish9k

Post on 08-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 MC0064 August 2010 Q & Ans

    1/21

    Master of Computer Application (MCA) Semester 1

    MC0064 Basic Web Development

    (Book ID: B0703)

    Assignment Set 1___________________________________________________________________

    Q. 1. Describe the following Internet technologies with suitable examples:

    A) E-CommerceB) JavaC) XML

    A). E-Commerce

    E-Commerce is about doing business electronically and encompasses many diverse activitiesboth in the business-to-business market and in the business-to-consumer market. Activitiesinclude electronic trading of goods and services, online delivery of digital content, electronicfund transfers, electronic share trading, commercial auctions, collaborative design andengineering, online sourcing, public procurement, direct consumer marketing, and after-salesservice. It involves both products (e.g. consumer goods) and services (e.g. informationservices, financial and legal services).Electronic commerce relate to commercial transaction of goods and services conductedbetween parties electronically mainly through open Internet based systems i.e. the partiesinteract electronically rather than by physical exchange or contact. A wide range ofcommunication technologies including e-mail, EDI, Internet, Intranet and Extranet can beused to support electronic commerce.

    Electronic commerce includes commercial transactions such as electronic trading of goodsand services, on line delivery of digital content, electronic fund transfers, electronic sharetrading, electronic bills of lading, collaborative design and engineering, on line sourcing,public procurement, direct and consumer market.The potential for the application of electronic commerce will continue to expand.

    Electronic Commerce: Trading via the Internet

    - Product Descriptions and Prices on a Website- Order and Delivery Conditions on that Website- Ordering via the Website (shopping cart systems; online order form)

    - Payment Order via Credit Card through the Website- Credit Card Verification in Real Time- Invoice Printout from the Website- (if digital content) Delivery from the Website- Costs Deducted from Customers Credit Card Account, Credited to Sellers Merchant

    Account

  • 8/7/2019 MC0064 August 2010 Q & Ans

    2/21

    B) Java

    Java is an object oriented language and a very simple language. Because it has no space forcomplexities. At the initial stages of its development it was called as OAK. OAK wasdesigned for handling set up boxes and devices. But later new features were added to it and itwas renamed as Java. Java became a general purpose language that had many features tosupport it as the internet language. Few of the features that favors it to be an internet language

    are:Cross Platform Compatibility: The java source files (java files with .java extension) aftercompilation generates the bytecode (the files with .class extension) which is further convertedinto the machine code by the interpreter. The byte code once generated can execute on anymachine having a JVM. Every operating system has it's unique Java Virtual Machine (JVM)and the Java Runtime Environment (JRE).Support to Internet Protocols: Java has a rich variety of classes that abstracts the Internetprotocols like HTTP , FTP, IP, TCP-IP, SMTP, DNS etc .Support to HTML: Most of the programming languages that are used for web applicationuses the html pages as a view to interact with the user. Java programming language provideit's support to html. For example. Recently the extension package jipxhtml is developed in

    java to parse and create the html 4.0 documents.Support to Java Reflection APIs: To map the functionalities, Java Reflection APIs providesthe mechanism to retrieve the values from respective fields and accordingly creates the javaobjects. These objects enables to invoke methods to achieve the desired functionality.Support to XML parsing: Java has JAXP-APIs to read the xml data and create the xmldocument using different xml parsers like DOM and SAX. These APIs provides mechanismto share data among different applications over the internet.Support to Web Services : Java has a rich variety of APIs to use xml technology in diverseapplications that supports N-Tiered Enterprise applications over the internet. Features likeJAXB , JAXM, JAX-RPC , JAXR etc enables to implement web services in javaapplications. It makes java a most suited internet language.

  • 8/7/2019 MC0064 August 2010 Q & Ans

    3/21

    C) XML

    XML is an acronym for "Extensible Markup Language". XML is the latest platform-independent and content-dependent technology available for Internet development. XML isthe tool of choice for distributing structured information in this age. A working group under

    the guidance World Wide Web Consortium (W3C) started developing XML to simplify thetransmission of documents across the internet.XML is a young meta language. In early 1998, W3C published the XML 1.0recommendations. Content developers have started developing various applications of XML -for example Mathematical Markup Language (MathML), CML - Chemical MarkupLanguage etc. W3C, while releasing the HTML 4.0 recommendation in early 1998, said thatit would approximately take 18 months to develop this transitional language. We have time tolearn the basics of XML and develop the future internet language.

    XML Goals

    The Goals of XML are defined (by the XML W3C Working Group) in the XML

    Specifications as:XML shall be straightforwardly usable over the Internet.XML shall support a wide variety of applications.XML shall be compatible with SGML.It shall be easy to write programs which process XML documents.The number of optional features in XML is to be kept to the absolute minimum, ideally zero.XML documents should be human-legible and reasonably clear.The XML design should be prepared quickly.The design of XML shall be formal and concise.XML documents shall be easy to create.Terseness in XML markup is of minimal importance.

    Q. 2. Describe the following types of servers with suitable examples:

    A) Mail Servers B) FTP Servers C) News Servers

    Ans.

    A) Mail Servers

    A mail server (also known as a mail transfer agent or MTA, a mail transport agent, a mailrouter or an Internet mailer) is an application that receives incoming e-mail from local users(people within the same domain) and remote senders and forwards outgoing e-mail fordelivery. A computer dedicated to running such applications is also called a mail server.Microsoft Exchange, qmail, Exim and sendmail are among the more common mail serverprograms.

    The mail server works in conjunction with other programs to make up what is sometimesreferred to as a messaging system. A messaging system includes all the applicationsnecessary to keep e-mail moving as it should. When you send an e-mail message, your e-mailprogram, such as Outlook or Eudora, forwards the message to your mail server, which in turnforwards it either to another mail server or to a holding area on the same server called amessage store to be forwarded later. As a rule, the system uses SMTP (Simple Mail Transfer

    Protocol) or ESMTP (extended SMTP) for sending e-mail, and either POP3 (Post OfficeProtocol 3) or IMAP (Internet Message Access Protocol) for receiving e-mail

    http://searchenterpriselinux.techtarget.com/sDefinition/0,,sid39_gci212961,00.htmlhttp://searchenterpriselinux.techtarget.com/sDefinition/0,,sid39_gci212961,00.html
  • 8/7/2019 MC0064 August 2010 Q & Ans

    4/21

    There are several different components to the email system. They work together to move,deliver or retrieve your email.

    Mail Transfer Agent (MTA)

    The MTA does a great deal of the hard work in moving mail around as it is responsible to

    move the mail from the local MTA to the destination MTA on the Internet. The Mail TransferAgent works closely with DNS in making this all happen. The MTA uses a specific languageSMTP to transfer mail on port 25, which is a standard. Several examples of MTAs areSendmail, Postfix, and QMAIL.

    Mail Delivery Agent (MDA)

    The MDA will receive the mail destined for the local network from the MTA and then willmake this mail available for the user. The MDA will use POP3 on port 110 or IMAP on port143 to make this available to users. Examples of MDA are Dovecot or Cyrus-IMAP.

    Mail User Agent (MUA)

    The MUA is the client program that the end user uses to retrieve and view email. Users areable to view web based email with a browser but will user tools like Outlook, Thunderbird,Mutt, or Evolution to download mail to the local machine.

    When you send or read your email, the only part you see is the MUA, which is a fancy wayof saying email client. But, theres a lot more than that involved. To send an email, youllfirst sit down at your computer and fire up Thunderbird, or whichever other email client thatyoure using. When you compose the message and click on the send button, the MUA willsend it to the MTA. (The MTA could either be on the corporate network or at your ISP.) ThisMTA will send the message to successive MTAs until it gets to the MTA that serves theemail recipient. This MTA will then send the message to a Post Office Protocol

    (POP)/Internet Mail Application Protocol (IMAP) server. This server will store the emailuntil the recipient accesses it with her MUA. Of course, this same process could take placewithin a corporate network instead of across the Internet.

    B) FTP Servers

    FTP stands for the File transfer protocol and is used to transfer files between an FTP serverand another computer. In the past, FTP was much more common than it is today and was thedominant file transfer mechanism on the Internet. If you needed to transfer files between twocomputers, you would use FTP to do so. FTP is still very popular today when a service

    requires that a lot of files be hosted for other to people to download. FTP also tends to befaster than other contemporary methods of transferring files because it was designed to do so.Even more important, FTP support Automatic Resume. This means that if you aredownloading the latest new game demo that is over 600 megs, and for some reason thedownload stops in the middle of the transfer, the ftp client will attempt to on the nextdownload of the same file, to continue from where you left off. This feature can save you ahuge amount of time but is generally only found in specialized FTP client software and not inyour browser software.

    How to Connect to an FTP Server

    There are two approaches to allowing users to connect to an FTP Server. The first is to makeit so anyone can log in anonymously, otherwise known as anonymous FTP, or you can assignuser names and passwords to people that they must use to log in to the server.

  • 8/7/2019 MC0064 August 2010 Q & Ans

    5/21

    The two most common ways to connect to an FTP server is with your Web Browser or with aFTP client such as FileZilla. To connect to a FTP server with your browser you would prefixthe hostname you are connecting to with the ftp:// protocol statement. For example,ftp://www.bleepingcomputer.com. It would then try to connect anonymously. If the serveryou are trying to connect to requires a username and password, you can do so in thefollowing format:

    ftp://username:[email protected] is recommended when you do connect with a username and a password that you do not putthe password in as well, otherwise it will show up in your browser's history. Instead do this:ftp://[email protected]

    This way your browser will prompt you for a password and you do not have to worry about itbeing stored in your history list, which can potentially be a security risk.

    The other method is to use a FTP client that is designed specifically to connect to FTPservers. These types of software are generally the best as they have been streamlined for

    speed and support a lot of the advanced features like automatic resume. You should browsethrough the list of FTP Clients and find one you like.

    How to Transfer Files

    Whether you are connected to an FTP server via your web browser or an FTP client, you willbe presented with a list of folders and documents that have files you can download to yourcomputer. If you are using a web browser, you will click on the file you would like todownload and it will prompt you to save it or open it. Unless you really know what it is youare downloading, you should save it to a directory that you will know how to find later, andopen it from there.

    If you are using an FTP Client, you will be presented a list of the files that you can download.You should first specify where you would like downloads to save to, and then you can doubleclick on the file to start the download. When you are done downloading, you can shut theFTP client and open the file from where it was stored.

    C) News Servers

    A news server is a set of computer software used to handle Usenet articles. It may also referto a computer itself which is primarily or solely used for handling Usenet. A reader serverprovides an interface to read and post articles, generally with the assistance of a news client.A transit server exchanges articles with other servers. Most servers can provide both

    functions

    The news server is a program that runs on a remote computer. A typical news server handlesrequests for a great many users, each of whom runs his own newsreader program on his owncomputer.

    From our point of view, a news server has two main jobs. First, it acts as a repository for thevery large number of Usenet articles and data files that are currently available.Second, whenever you post that is, send out an article of your own, your newsreadersends it to your news server, which then distributes it to other servers. Thus, every newsserver acts as both a repository and a distribution point.The protocol (technical system) used to distribute news articles is called NNTP, which stands

    for "Network News Transfer Protocol". For this reason, news servers are sometimes calledNNTP SERVERS.

  • 8/7/2019 MC0064 August 2010 Q & Ans

    6/21

    News servers operation

    Among the operators and users of commercial news servers, common concerns are thecontinually increasing storage and network capacity requirements and their effects.

    Completion (the ability of a server to successfully receive all traffic), retention (the amount oftime articles are made available to readers) and overall system performance are the topics offrequent discussion. With the increasing demands, it is common for the transit and readerserver roles to be subdivided further into numbering, storage and front end systems. Theseserver farms are continually monitored by both insiders and outsiders, and measurements ofthese characteristics are often used by consumers when choosing a commercial news service.

    Q. 3. With the help of relevant coding explain the usage of HTML constructs.

    Ans. :

    HTML is an acronym, standing for Hypertext Markup Language. Its a language that can betransferred around the Internet and read by a Web Browser, such as Microsoft InternetExplorer, or Netscape Navigator. Markup tells your browser how your document isstructured, and to varying extents, what it looks like. All content is defined by the markup"tags" of HTML.An HTML tag is a container for whatever you put within that tag. For example, the bold tag is used to make text bold. If you want the words "Hello everyone" to be in a emboldenedstyle on your document, you would then encapsulate it within bold tags. For example:-Something Important to remember*Before we go any further, we'll run through the required steps to create a valid HTML

    document.

    Basic Document structure

    Every page must contain an opening "tag" - thus indicating to the browser that theof code is markup to be rendered.

    The section follows, which will contain whats known as document headers. Theseheaders don't actually render anything visible to the end user, but provide information aboutthat document (Metadata) and varying other references to scripts or style sheets.

    The head section also contains the tag which displays on the blue bar at the top leftof the browser window and also provides the text for a favourites listing. After the title tag isopened and the text inserted, the tag must be closed using . When all the pageheaders are set, the head section is closed, by entering .

    The section of a web document where the majority of content and markup is displayed andrendered, is within the tag. Commonly, the body tag will contain the bulk of tables,images and links. After the content of the webpage has finished, the body tag is then closed(), and the whole document closed by

    HTML Constructs

    In an HTML file, the contents must be preceded by a head section which minimally consists

    of two constructs. Our HTML code would be as follows:Example

  • 8/7/2019 MC0064 August 2010 Q & Ans

    7/21

    Title TagHelloHello worldExample

    Head and Body TagHelloHello worldThis means that apart from the first line, the entire file is an HTML element which contains a

    HEAD element, with the TITLE element as contents, and a BODY element, with the plaintext as contents.Thus, in the absence of HTML, HEAD, and TITLE tags a browser implicitly assumes them insuitable places. Therefore, your document always contains a head and a body.Table Tag 1 0 0 1

    and it looks like the following on a typical browser:

    1 0

    0 1

    Thus, the TABLE tags enclose the table rows, each of which is enclosed by TR tags andenclose table cells enclosed by TD tags. This corresponds to the logical structure of a table asa set of rows consisting of cells. You can abbreviate the table structure by omitting the TDand TR end tags (since a browser implicitly assumes them), but at the expense of losing thelogical clarity to some extent:

    1 0 0 1Moreover, although omitting those end tags is legal HTML 3.2, it may in practise confusesome browsers (including Netscape) in some cases.

    The use of blanks and newlines in the HTML code for a table is irrelevant to the visualappearance of a table when viewed with a browser, since that appearance is controlled byHTML tags. However, it is often useful to position table elements suitably in the HTML codeso that items in the same column are adjusted to make the structure clear for you (or whoeverhas to maintain the HTML document).

    Additional features; a typical table with text cells

  • 8/7/2019 MC0064 August 2010 Q & Ans

    8/21

    There are several separate features which you will often like to add to this simple tablemodel:A caption for the table, attached to the table itself (as opposite to telling about the table in thenormal text of the document).Headers (explanations) for table rows or columns or both.

    Borders around the table and each table cell.The following, rather typical, example uses all of the above-mentioned features:

    Example

    An illustration of the use of the TABLE element in HTML.

    Finnish, English, and scientific names for some animalsFinnish nameEnglish nameScientificnamehirvielkAlces alcesoravasquirrelSciurus vulgarissusiwolfCanis lupusAfghanistanAlbaniaAlgeriaAmerican SamoaAndorra

    AngolaAnguillaAntarcticaAntigua and BarbudaArctic OceanArgentinaArmenia

    Advantages

    Easy to use Loose syntax (although, being too flexible will not comply with standards)

    Supported on almost every browser, if not all browsers.Widely used; established on almost every website, if not all websites.

    Very similar to XML syntax, which is increasingly used for data storage

    Free - You need not buy any software

    Easy to learn & code even for novice programmers

    Disadvantages

    It cannot produce dynamic output alone, since it is a static language

    Sometimes, the structuring of HTML documents is hard to grasp

    You have to keep up with deprecated tags, and make sure not to use them

    http://www.blurtit.com/q5478433.htmlhttp://www.blurtit.com/q5478433.htmlhttp://www.blurtit.com/q5478433.htmlhttp://www.blurtit.com/q5478433.htmlhttp://www.blurtit.com/q5478433.htmlhttp://www.blurtit.com/q5478433.htmlhttp://www.blurtit.com/q5478433.htmlhttp://www.blurtit.com/q5478433.html
  • 8/7/2019 MC0064 August 2010 Q & Ans

    9/21

    Deprecated tags appear because another language that works with HTML hasreplaced the original work of the tag; thus the other language needs to be learned(most of the time, it is CSS)

    Security features offered by HTML are limited

    Q.4. Describe the concept and working of Web browsers. Discuss and distinguish

    between Internet Explorer and Mozilla FireFox browsers.

    Ans.:

    Web BrowserA web browser or Internet browser is a software application for retrieving, presenting, andtraversing information resources on the World Wide Web. An information resource isidentified by a Uniform Resource Identifier (URI) and may be a web page, image, video, or

    other piece of content. Hyperlinks present in resources enable users to easily navigate theirbrowsers to related resources.

    Working of Web Browsers:Web browsers consist of client software that runs on your computer and displays home pageson the Web. There are clients for a wide variety of devices, including Windows, Macintosh,and Unix computers.

    A web browser displays information on your computer by interpreting the Hypertext MarkupLanguage (HTML) that is used to build home pages on the Web. Home pages usually displaygraphics, sound, and multimedia files, as well as links to other pages, files that can be

    downloaded and other Internet resources.The coding in the HTML files tells your browser how to display the text, graphics, links, andmultimedia files on the home page. The HTML file your browser loads to display the homepage doesnt actually have the graphics, sound, multimedia files, and other resources on it.Instead, it contains HTML references to those graphics and files. Your browser uses thosereferences to find the files on the server and then display them on the home page.

    The web browser also interprets HTML tags as links to other websites, or to other webresources, such as graphics, multimedia files, newsgroups, or files to download. Dependingon the link, it performs different actions. For example, if the HTML code specifies the link asanother home page, the browser retrieves the URL specified in the HTML file when the user

    clicks the underlined link on the page. If the HTML code specifies a file to be downloaded,the browser downloads the file to your computer.

    Internet Explorer:

    Windows Internet Explorer (formerly Microsoft Internet Explorer, commonly abbreviated IEor MSIE) is a series of graphical web browsers developed by Microsoft and included as partof the Microsoft Windows line of operating systems starting in 1995.

    Standards support

    Internet Explorer, using the Trident layout engine:supports HTML 4.01, CSS Level 1, XML 1.0, and DOM Level 1, with minor implementationgaps.

    http://www.blurtit.com/q5478433.htmlhttp://www.blurtit.com/q5478433.html
  • 8/7/2019 MC0064 August 2010 Q & Ans

    10/21

    fully supports XSLT 1.0 as well as an obsolete Microsoft dialect of XSLT often referred to asWD-xsl, which was loosely based on the December 1998 W3C Working Draft of XSL.Support for XSLT 2.0 lies in the future: semi-official Microsoft bloggers have indicated thatdevelopment is underway, but no dates have been announced.Partially supports CSS Level 2 and DOM Level 2, with major implementation gaps and

    conformance issues. Almost full conformance to CSS 2.1 has been added in the InternetExplorer 8 release.supports XHTML in Internet Explorer 9 (Trident version 5.0). Prior versions can renderXHTML documents authored with HTML compatibility principles and served with atext/html MIME-type.fully supports SVG in Internet Explorer 9 (Trident version 5.0).

    Security

    Internet Explorer uses a zone-based security framework that groups sites based on certainconditions, including whether it is an Internet- or intranet-based site as well as a user-editable

    whitelist. Security restrictions are applied per zone; all the sites in a zone are subject to therestrictions.

    Internet Explorer has been subjected to many security vulnerabilities and concerns: Much ofthe spyware, adware, and computer viruses across the Internet are made possible byexploitable bugs and flaws in the security architecture of Internet Explorer, sometimesrequiring nothing more than viewing of a malicious web page in order to install themselves.This is known as a "drive-by install". There are also attempts to trick the user into installingmalicious software by misrepresenting the software's true purpose in the description sectionof an ActiveX security alert.

    Mozilla Firefox:

    Mozilla Firefox is a free and open source web browser descended from the MozillaApplication Suite and managed by Mozilla Corporation. As of February 2011. Firefox is thesecond most widely used browser with approximately 30% of worldwide usage share of webbrowsers.

    Standards Support:

    Mozilla Firefox implements many web standards, including HTML, XML, XHTML,MathML, SVG 1.1 (partial), CSS (with extensions), ECMAScript (JavaScript), DOM, XSLT,

    XPath, and APNG (Animated PNG) images with alpha transparency. Firefox alsoimplements standards proposals created by the WHATWG such as client-side storage, andcanvas element.

    Security

    Firefox uses a sandbox security model, and limits scripts from accessing data from other websites based on the same origin policy. It uses SSL/TLS to protect communications with webservers using strong cryptography when using the HTTPS protocol. It also provides supportfor web applications to use smartcards for authentication purposes

    http://en.wikipedia.org/wiki/MathMLhttp://en.wikipedia.org/wiki/XPathhttp://en.wikipedia.org/wiki/MathMLhttp://en.wikipedia.org/wiki/XPath
  • 8/7/2019 MC0064 August 2010 Q & Ans

    11/21

    Master of Computer Application (MCA) Semester 1

    MC0064 Basic Web Development

    (Book ID: B0703)

    Assignment Set 2___________________________________________________________________

    Q. 1. Describe the HTML text tags with coding and demonstrate the corresponding

    output on the HTML page.

    Answer:

    HTML is a language for describing web pages.HTML stands for Hyper Text Markup LanguageHTML is not a programming language, it is a markup language

    A markup language is a set of markup tagsHTML uses markup tags to describe web pagesHTML TagsHTML markup tags are usually called HTML tagsHTML tags are keywords surrounded by angle brackets like HTML tags normally come in pairs like and The first tag in a pair is the start tag, the second tag is the end tagStart and end tags are also called opening tags and closing tagsText Tag

    FONT COLOR

    ExampleTest text.Test text.

    FONT FACESTest text compared to default text.Test text compared to default text.Test text compared to default text.

    Test text compared to default text.FONT PHYSICAL STYLESBlackface Text, compared to normal text.

    Blackface Text, compared to normal text.Bold Text, compared to normal text.Bold Text, compared to normal text.Code Text, compared to normal text.Code Text, compared to normal text.Deleted Text, compared to normal text.Deleted Text, compared to normal text.Inserted Text, compared to normal text.Inserted Text compared to normal text.Italicized Text, compared to normal text.Italicized Text, compared to normal text.Quoted Text, compared to normal text.Quoted Text, compared to normal text.

  • 8/7/2019 MC0064 August 2010 Q & Ans

    12/21

    Striked-Out Text, compared to normal text.(Note: 2.0 Standard)Striked-Out Text, compared to normal text.Striked-Out Text, compared to normal text.(Note: 3.0 Standard)

    Striked-Out Text, compared to normal text.Underlined Text, compared to normal text.Underlined Text, compared to normal text.Typerwriter Style, compared to normal text.Typerwriter Style, compared to normal text.FONT SIZES

    Test textTest textTest textTest text

    Test textTest text

    HEADERSNormal text before Header 1 text, normal text after.Normal text beforeHeader 1 text,normal text after.Normal text before Header 2 text, normal text after.Normal text beforeHeader 2 text,normal text after.Normal text before Header 3 text, normal text after.Normal text beforeHeader 3 text,normal text after.Normal text before Header 4 text, normal text after.Normal text beforeHeader 4 text,normal text after.Normal text before Header 5 text, normal text after.

    Normal text beforeHeader 5 text,normal text after.Normal text before Header 6 text, normal text after.Normal text beforeHeader 6 text,normal text after.

  • 8/7/2019 MC0064 August 2010 Q & Ans

    13/21

    2. Describe the theory of table formatting for visual user agents.

    Answer :

    The following description describes the HTML table attributes that tell visual user agentshow to format tables. Style sheets will offer better control of visual table formatting. At the

    writing of this specification, [CSS1] did not offer mechanisms to control all aspects of visualtable formatting.This version of HTML includes mechanisms to control:horizontal and vertical alignment of cell contentsborder stylesand cell marginsHorizontal and vertical alignment

    The following attributes may be set for different table elements (see their definitions).

    Attribute definitionsalign = left|center|right|justify|charThis attribute specifies the alignment of data and the justification of text in a cell. Possiblevalues:left: Left-flush data/Left-justify text. This is the default value for table data.center: Center data/Center-justify text. This is the default value for table headers.right: Right-flush data/Right-justify text.justify: Double-justify text.char:Align text around a specific character.valign = top|middle|bottom|baselineThis attribute specifies the vertical position of data within a cell. Possible values:top: Cell data is flush with the top of the cell.middle: Cell data is centered vertically within the cell. This is the default value.bottom: Cell data is flush with the bottom of the cell.

    baseline: All cells in the same row as a cell whose valign attribute has this value should havetheir textual data positioned so that the first text line occurs on a baseline common to all cellsin the row. This constraint does not apply to subsequent text lines in these cells.char = cdataThis attribute specifies a character within a text fragment which will act as an axis foralignment. The default value for this attribute is the decimal point character for the currentlanguage as set by the lang attribute (e.g., the period (".") in English and the comma (",") inFrench). The value of this attribute is case-sensitive.charoff = lengthWhen present, this attribute specifies the offset to the first occurrence of the alignmentcharacter on each line. If a line doesn't include the alignment character, it should be

    horizontally shifted to end at the alignment position.

    http://www.w3.org/TR/WD-html40-970917/references.html#ref-CSS1http://www.w3.org/TR/WD-html40-970917/struct/tables.html#alignmenthttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#bordershttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#marginshttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-align-TDhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charoffhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-valignhttp://www.w3.org/TR/WD-html40-970917/types.html#type-cdatahttp://www.w3.org/TR/WD-html40-970917/struct/dirlang.html#adef-langhttp://www.w3.org/TR/WD-html40-970917/types.html#type-lengthhttp://www.w3.org/TR/WD-html40-970917/references.html#ref-CSS1http://www.w3.org/TR/WD-html40-970917/struct/tables.html#alignmenthttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#bordershttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#marginshttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-align-TDhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charoffhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-valignhttp://www.w3.org/TR/WD-html40-970917/types.html#type-cdatahttp://www.w3.org/TR/WD-html40-970917/struct/dirlang.html#adef-langhttp://www.w3.org/TR/WD-html40-970917/types.html#type-length
  • 8/7/2019 MC0064 August 2010 Q & Ans

    14/21

    When charoff is used to set the offset of an alignment character, the direction of offset isdetermined by the current text direction (set by the dir attribute). In left-to-right texts (thedefault), offset is from the left margin. In right-to-left texts, offset is from the right margin.The table in this example aligns a row of currency values along a decimal point. We set thealignment character to "." explicitly.

    Vegetable Cost per kiloLettuce $1Silver carrots $10.50Golden turnips $100.30The formatted table should look something like this:

    ------------------------------| Vegetable |Cost per kilo||--------------|-------------||Lettuce | $1 ||--------------|-------------||Silver carrots| $10.50||--------------|-------------||Golden turnips| $100.30|------------------------------Inheritance of alignment specificationsThe alignment of cell contents can be specified on a cell by cell basis, or inherited fromenclosing elements, such as the row, column or the table itself.The order of precedence (from highest to lowest) for the attributes align, char, and charoffisthe following:An alignment attribute set on an element within a cell's data (e.g., P).An alignment attribute set on a cell (TH and TD).An alignment attribute set on a column or column group (COL and COLGROUP). When acell is part of a multi-column span, the alignment property is inherited from the cell definitionat the beginning of the span.An alignment attribute set on a row or row group (TR, THEAD, TFOOT, and TBODY).When a cell is part of a multi-row span, the alignment property is inherited from the cell

    definition at the beginning of the span.An alignment attribute set on the table (TABLE).The default alignment value.The order of precedence (from highest to lowest) for the attribute valign (as well as the otherinherited attributes lang, dir, and style) is the following:An attribute set on an element within a cell's data (e.g., P).An attribute set on a cell (TH and TD).An attribute set on a row or row group (TR, THEAD, TFOOT, and TBODY). When a cell ispart of a multi-row span, the attribute value is inherited from the cell definition at thebeginning of the span.An attribute set on a column or column group (COL and COLGROUP). When a cell is part

    of a multi-column span, the attribute value is inherited from the cell definition at thebeginning of the span.

    http://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charoffhttp://www.w3.org/TR/WD-html40-970917/struct/dirlang.html#adef-dirhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-align-TDhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charoffhttp://www.w3.org/TR/WD-html40-970917/struct/text.html#edef-Phttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TDhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLGROUPhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TRhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THEADhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TFOOThttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TBODYhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TABLEhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-valignhttp://www.w3.org/TR/WD-html40-970917/struct/dirlang.html#adef-langhttp://www.w3.org/TR/WD-html40-970917/struct/dirlang.html#adef-dirhttp://www.w3.org/TR/WD-html40-970917/present/styles.html#adef-stylehttp://www.w3.org/TR/WD-html40-970917/struct/text.html#edef-Phttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TDhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TRhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THEADhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TFOOThttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TBODYhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLGROUPhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charoffhttp://www.w3.org/TR/WD-html40-970917/struct/dirlang.html#adef-dirhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-align-TDhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-charoffhttp://www.w3.org/TR/WD-html40-970917/struct/text.html#edef-Phttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TDhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLGROUPhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TRhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THEADhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TFOOThttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TBODYhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TABLEhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-valignhttp://www.w3.org/TR/WD-html40-970917/struct/dirlang.html#adef-langhttp://www.w3.org/TR/WD-html40-970917/struct/dirlang.html#adef-dirhttp://www.w3.org/TR/WD-html40-970917/present/styles.html#adef-stylehttp://www.w3.org/TR/WD-html40-970917/struct/text.html#edef-Phttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TDhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TRhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THEADhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TFOOThttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TBODYhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLGROUP
  • 8/7/2019 MC0064 August 2010 Q & Ans

    15/21

    An attribute set on the table (TABLE).The default attribute value.Furthermore, when rendering cells, horizontal alignment is determined by columns inpreference to rows, while for vertical alignment, rows are given preference over columns.The default alignment for cells depends on the user agent. However, user agents should

    substitute the default attribute for the current directionality (i.e., not just "left" in all cases).User agents that do not support the "justify" value of the align attribute should use the valueof the inherited directionality in its place.Borders and rulesNote.The HTML attributes for specifying borders and rules on tables are deprecated in favorof style sheets. For example, the "border" property in [CSS1] may serve this purpose.The following attributes affect a table's external frame and internal rules.Attribute definitionsframe = void|above|below|hsides|lhs|rhs|vsides|box|borderDeprecated. This attribute specifies which sides of the frame that surrounds a table will bevisible. Possible values:

    void: No sides. This is the default value.above: The top side only.below: The bottom side only.hsides: The top and bottom sides only.vsides: The right and left sides only.lhs: The left-hand side only.rhs: The right-hand side only.box: All four sides.border: All four sides.rules = none|groups|rows|cols|allDeprecated.This attribute specifies which rules will appear between cells within a table. Therendering of rules is user agent dependent. Possible values:none: No rules. This is the default value.groups: Rules will appear between row groups (see THEAD, TFOOT, and TBODY) andcolumn groups (see COLGROUP and COL) only.rows: Rules will appear between rows only.cols: Rules will appear between columns only.all: Rules will appear between all rows and columns.border = cdataDeprecatedThis attributes specifies the width (in pixels only) of the frame around a table (seethe Note below for more information about this attribute).

    In the following table, borders five pixels thick will be rendered on the left- and right-handsides of the table and rules should be displayed between all columns. 1 2 3 4 5 6 7 8 9The following settings should be observed by user agents for backwards compatibility.Setting border="0" implies frame="void" and, unless otherwise specified, rules="none".Other values of border imply frame="border" and, unless otherwise specified, rules="all".The value "border" in the start tag of the TABLE element should be interpreted as the value

    of the frame attribute. It implies rules="all" and some default (non-zero) value for the borderattribute.

    http://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TABLEhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-align-TDhttp://www.w3.org/TR/WD-html40-970917/references.html#ref-CSS1http://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THEADhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TFOOThttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TBODYhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLGROUPhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLhttp://www.w3.org/TR/WD-html40-970917/types.html#type-cdatahttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-borderhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-framehttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-ruleshttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-borderhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-framehttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-ruleshttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TABLEhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-framehttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-ruleshttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-borderhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TABLEhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-align-TDhttp://www.w3.org/TR/WD-html40-970917/references.html#ref-CSS1http://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-THEADhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TFOOThttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TBODYhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLGROUPhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-COLhttp://www.w3.org/TR/WD-html40-970917/types.html#type-cdatahttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-borderhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-framehttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-ruleshttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-borderhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-framehttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-ruleshttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#edef-TABLEhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-framehttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-ruleshttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-border
  • 8/7/2019 MC0064 August 2010 Q & Ans

    16/21

    Thus, for example, the following definitions are equivalent:and the following definitions too:

    Note. The border attribute also defines the border behavior for the OBJECT and IMGelements, but takes different values for those elements.Cell marginsTwo attributes control spacing between and within cells.Attribute definitionscellspacing = lengthThis attribute specifies how much space should be left between the table frame and the firstor last cell border for each row or column, and between the cells in a table.cellpadding = lengthThis attribute specifies the amount of space between the border of the cell and its contents, on

    all sides of the contents.In the following table, the cellspacing attribute specifies that cells will be separated from eachother and from the table frame by twenty pixels. The cellpadding attribute specifies that thetop margin of the cell and the bottom margin of the cell will each be separated from the cell'scontents by 10% of the available vertical space (the total being 20%). Similarly, the leftmargin of the cell and the right margin of the cell will each be separated from the cell'scontents by 10% of the available horizontal space (the total being 20%). Data1 Data2 Data3If a table or given column has a fixed width, cellspacing and cellpadding may demand morespace than assigned. We recommend that user agents give these attributes precedence overthe width attribute when a conflict occurs, but this is not a requirement.

    3. With the help of relevant examples demonstrate the usage of the Anchor and LINK

    tags in HTML.

    Answer.

    Anchor Tag:Anchors enable you to connect documents to one another. There are three kinds ofconnections:Connecting two documents in the same directory.Connecting two documents in different directories.Connecting one part of a document to a particular location within a document.Every link begins the same way. You must write a tag that hotwires a document. Everythingafter this tag, whether an image or text, will be blue and underlined. If someone clicks thathotwired material, Netscape will take them to another document or a particular location.Connecting two documents in the same directory.To begin the hotwiring, type the following tag:

    http://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-borderhttp://www.w3.org/TR/WD-html40-970917/struct/objects.html#edef-OBJECThttp://www.w3.org/TR/WD-html40-970917/struct/objects.html#edef-IMGhttp://www.w3.org/TR/WD-html40-970917/types.html#type-lengthhttp://www.w3.org/TR/WD-html40-970917/types.html#type-lengthhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-cellspacinghttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-cellpaddinghttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-cellspacinghttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-cellpaddinghttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-width-THhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-borderhttp://www.w3.org/TR/WD-html40-970917/struct/objects.html#edef-OBJECThttp://www.w3.org/TR/WD-html40-970917/struct/objects.html#edef-IMGhttp://www.w3.org/TR/WD-html40-970917/types.html#type-lengthhttp://www.w3.org/TR/WD-html40-970917/types.html#type-lengthhttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-cellspacinghttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-cellpaddinghttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-cellspacinghttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-cellpaddinghttp://www.w3.org/TR/WD-html40-970917/struct/tables.html#adef-width-TH
  • 8/7/2019 MC0064 August 2010 Q & Ans

    17/21

    "file.html" refers to another document in the same directory. Remember that this tag is case-sensitive, so make certain that capital and lower-case letters are the same as they appear inthe actual document name.Technically speaking, whatever follows this tag will be the link. The tag itself will notconnect the documents. Instead, people must have some clickable material in order to make

    the connection. After you have inserted that material, whether text or an image tag, type thefollowing:This tag ends the hotwiring.Connecting two documents in different directoriesThis sort of link works much the same way as connecting documents in the same directory.You just have to provide some more information. Start the tag the same way, but rather thaninserting just the file name, you need to include the whole URL (the World Wide Webaddress that you would use to read any document in Netscape).

    Let's use the same example, where you are connecting "home.html" to "document.html."

    Except this time, "document.html" is on the main UVa Web directory. The tagging structurewould read as follows:Click here to read another document.Connecting one part of a document to a particular location within a documentThis is the most complicated sort of connection you are likely to create. It involves not only alink (a tag saying where you want to connect), but an anchor, which says where you want togo. With links between documents, you do not need to designate a particular location;Netscape simply goes to the beginning. In this case, you must say where you want to go.The process begins like other links, with an tag. But the space betweenquotation marks includes a # and some sort of indicator, any number, word, or letter. Youwill use this number, word, or letter again later in the document.

    Now move to the place in the document where you want link to go. Type the following tag:The space after the = sign should be the same number, word, or letter that you used in thelink.Part I Part IILater in the document, you will include the following tags: and The tags should appear at the beginning or Part I. If someone clicks onthe link, Netscape will automatically go to the anchor tag.These anchor tags can appear anywhere in the document. All they do is tell Netscape whereto go when someone clicks on the initial linking tag.

    In addition to linking part of a document to another part of that same document, you can linkone document to part of another document in the same directory, or to a document in anotherdirectory. To do this you will combine the various principles of links and anchors. Forexample, if you wanted to connect some text in "home.html" to a particular place in"document.html", you would write the following:Click here

  • 8/7/2019 MC0064 August 2010 Q & Ans

    18/21

    The HTML link tag works like the HTML a tag, but it's defined only in the head section ofthe document, and is used mostly to give relational information about it. For example, youcan use the HTML link tag to say where in a chapter is this document located, or whichdocument works as an index for it, or to specify alternate versions that are written in otherlanguages or for other media.

    Chapter two...Document's body...The HTML link tag is commonly used to point to external style sheet files:

    Code begin Relation AttributeDescribes de relationship from the current document to the destination resource. In otherwords defines the meaning of the referred resource for the actual document.There are many different types of links you can include in your documents:stylesheet - the most commonly used link type, this refers to an external style sheetalternate - substitute versions of the page. These can be in other languages (such as Frenchor Spanish) or other media types (such as PDF or PostScript)start - the first document in a series of documents, of which the current page is a membernext - the next document in a series, following the current pageprev - the previous document in a series, preceding the current page

    contents - refers to a document that acts as a table of contents for the pagestoc - an alternate reference to a table of contents, not all browsers support this typeindex - refers to a document that acts as an index for the current pageglossary - refers to a document that provides a glossary of terms related to the current pagecopyright - a copyright statement for the current pagechapter - refers to a document serving as a chapter in a collection of documentssection - refers to a document serving as a section in a collection of documentssubsection - refers to a document serving as a subsection in a collection of documentsappendix - refers to a document serving as an appendix in a collection of documentshelp - refers to a document that provides help about the current document, including moreinformation, other sources, and so on

    bookmark - refers to a bookmark or key entry point within an extended document

    http://www.htmlquick.com/reference/tags/a.htmlhttp://www.htmlquick.com/reference/tags/a.html
  • 8/7/2019 MC0064 August 2010 Q & Ans

    19/21

    Q. 4. Explain the applications of style sheets in web pages with coding examples.

    Answer:

    Cascading Style Sheet:

    CSS is the language for describing the presentation of Web pages, including colors, layout,and fonts. It allows to adapt the presentation to different types of devices, such as largescreens, small screens, or printers. CSS is independent of HTML and can be used with anyXML-based markup language. The separation of HTML from CSS makes it easier tomaintain sites, share style sheets across pages, and tailor pages to different environments.This is referred to as the separation of structure (or: content) from presentation.CSS stands for Cascading Style SheetsStyles define how to display HTML elementsStyles were added to HTML 4.0 to solve a problemExternal Style Sheets can save a lot of workExternal Style Sheets are stored in CSS files

    Styles are normally saved in external .css files. External style sheets enable you to change theappearance and layout of all the pages in a Web site, just by editing one single file!

    Drawbacks of HTML

    HTML was never intended to contain tags for formatting a document.HTML was intended to define the content of a document, like:This is a heading

    This is a paragraph.

    When tags like , and color attributes were added to the HTML 3.2 specification, itstarted a nightmare for web developers. Development of large web sites, where fonts and

    color information were added to every single page, became a long and expensive process.To solve this problem, the World Wide Web Consortium (W3C) created CSS.In HTML 4.0, all formatting could be removed from the HTML document, and stored in aseparate CSS file.All browsers support CSS today.

    Advantage

    Flexibility

    By combining CSS with the functionality of a Content Management System, a considerableamount of flexibility can be programmed into content submission forms. This allows acontributor, who may not be familiar or able to understand or edit CSS or HTML code to

    select the layout of an article or other page they are submitting on-the-fly, in the same form.For instance, a contributor, editor or author of an article or page might be able to select thenumber of columns and whether or not the page or article carries an image. This informationis then passed to the Content Management System, and the program logic evaluates theinformation and determines, based on a certain number of combinations, how to apply classesand IDs to the HTML elements, therefore styling and positioning them according to the pre-defined CSS for that particular layout type. When working with large-scale, complex sites,with many contributors such as news and informational sites, this advantage weighs heavilyon the feasibility and maintenance of the project.Separation of content from presentationCSS facilitates publication of content in multiple presentation formats based on nominal

    parameters. Nominal parameters include explicit user preferences, different web browsers,

    http://www.w3.org/Style/CSS/http://en.wikipedia.org/wiki/Content_Management_Systemhttp://www.w3.org/Style/CSS/http://en.wikipedia.org/wiki/Content_Management_System
  • 8/7/2019 MC0064 August 2010 Q & Ans

    20/21

    the type of device being used to view the content (a desktop computer or mobile Internetdevice), the geographic location of the user and many other variables.Site-wide consistencyMain articles: Separation of presentation and content and Style sheet (web development)

    When CSS is used effectively, in terms of inheritance and "cascading," a global style sheetcan be used to affect and style elements site-wide. If the situation arises that the styling of theelements should need to be changed or adjusted, these changes can be made by editing rulesin the global style sheet. Before CSS, this sort of maintenance was more difficult, expensiveand time-consuming.

    Bandwidth

    A style sheet is usually stored in the browser cache, and can therefore be used on multiplepages without being reloaded, reducing data transfer over a network.Page reformatting

    With a simple change of one line, a different style sheet can be used for the same page. Thishas advantages for accessibility, as well as providing the ability to tailor a page or site todifferent target devices. Furthermore, devices not able to understand the styling still displaythe content.

    font-size: 12pt;font-weight: medium;}.title

    {text-decoration: bold;

    color: green;font-family: "ms sans serif";font-size: 24pt;font-weight: heavy;}

    .bold{text-decoration: bold;color: black;font-family: "courier, arial";font-size: 14pt;font-weight: heavy;

    }a:link{

    text-decoration: none;color: red;

    http://en.wikipedia.org/wiki/Separation_of_presentation_and_contenthttp://en.wikipedia.org/wiki/Style_sheet_(web_development)http://en.wikipedia.org/wiki/Cachehttp://en.wikipedia.org/wiki/Separation_of_presentation_and_contenthttp://en.wikipedia.org/wiki/Style_sheet_(web_development)http://en.wikipedia.org/wiki/Cache
  • 8/7/2019 MC0064 August 2010 Q & Ans

    21/21

    font-family: "ms sans serif";font-size: 12pt;font-weight: heavy;

    }.head

    {color: #000000;font-family: "ms sans serif";font-size: 35px;margin-top: 35px;margin-left: 28px;

    }.foo{

    text-decoration: underline;color: #00FF00;

    font-family: "courier";font-size: 14pt;font-weight: heavy;

    }-->

    Cascading Style Sheet ExamplesHead text

    View source for coding or
    go to the CSS example

    page

    Non-foo text. Foo Text :-) More non-footext.

    "Regularly" Bolded Text

    CSS Bolded Text

    Cascading Style Sheet ExamplesHead text

    View source for coding orgo to the CSS example page

    Non-foo text. Foo Text :-) More non-foo text.

    "Regularly" Bolded Text

    CSS Bolded Text

    http://www.mountaindragon.com/html/css.htmhttp://www.mountaindragon.com/html/css.htmhttp://www.mountaindragon.com/html/css.htm