Sie sind auf Seite 1von 17

Submitted By: Shikha Bhatia MBA 2nd Semester Roll No.

Index
Sr. No
1

Assignment
Create a simple web page showing the use of title, paragraph and various font and Formatting options in HTML. Explain Font Tag in HTML. Explain image Tag in HTML. Explain the use of Hyperlink Tag in HTML. Explain the use of List Tag in HTML.

Page No

Remarks

2 3 4 5

Explain the use of Table in HTML

HTML
Introduction
HTML stands for Hyper Text Markup Language. An HTML file is a text file containing markup tags. The markup tags tell the Web browser how to display the page. An HTML file must have an htm or html file extension. An HTML file can be created using a simple text editor like Note Pad. Assignment 1. Create a simple web page showing the use of title, paragraph and various font and Formatting options in HTML. Solution: The various steps should be followed: 1. Start Notepad. To start Notepad, Go to Start-> Programs->Accessories->Notepad. The Notepad window will open and look like as:

2. The Notepad is opened and type the source tags in the notepad editor. 3. After typing the code, save the file. To save the file goto File->Save. This will asked us to save the file at particular location. Select the location and save the file with .html extension and click on the save button.The save dialog box appears as:

4. Double click the saved file the browser will display the page.

Title Tag
The <title> tag is required in all HTML documents and it defines the title of the document. The <title> element: defines a title in the browser toolbar provides a title for the page when it is added to favorites displays a title for the page in search-engine results Source code: <html> <head> <title></title> </head> <body>The content of the document......</body> </html>

Paragraph Tag
Paragraphs are defined with the <p> tag. <p>This is a paragraph</p> <p>This is another paragraph</p> HTML automatically adds an extra blank line before and after a paragraph.

Bold, Italics, Underline Tag


<b></b> <i></i> <u></u>

Alignment Tags
It is possible to align block elements (tables, images, objects, paragraphs, etc.) on the canvas with the align attribute. Although this attribute may be set for many HTML elements, its range of possible values sometimes differs from element to element. Here we only discuss the meaning of the align attribute for text. Attribute definitions align = left|center|right|justify This attribute specifies the horizontal alignment of its element with respect to the surrounding context. Possible values: left: text lines are rendered flush left. center: text lines are centered. right: text lines are rendered flush right. justify: text lines are justified to both margins. The default depends on the base text direction. For left to right text, the default is align=left, while for right to left text, the default is align=right. For Example: <p ALIGN=Left>Text <p ALIGN=Right> Text <p ALIGN=Centre> Text

Strike Tag
The HTML strike tag is used for rendering a strike (or line) through the middle of the text. <strike></strike>

Blinking Tag
<blink></blink>

Subscript and Superscript Tags


<sub>subscript</sub> <sup>Superscript</sup>

Heading Tags
The <h1> to <h6> tags are used to define HTML headings. <h1> defines the most important heading. <h6> defines the least important heading. <h1>This is heading 1</h1> <h2>This is heading 2</h2> <h3>This is heading 3</h3> <h4>This is heading 4</h4> <h5>This is heading 5</h5>

<h6>This is heading 6</h6> Example

Output

Assignment 2: Explain Font Tag in HTML.

Solution: The HTML element FONT is an inline element used to change font sizes, font colors and font styles of the text in your web pages. (i) Font Size: The font used by default is the one which is set up as the default text font in browser. Usually this is "Times New Roman", black color and size 3. To change the font size of the text on your web pages, we simply embed the text in the FONT element and add the SIZE attribute with a value between 1 (very small) and 7 (very big) to the opening font tag. (ii) Font Colors: To change the text color we need to add the attribute COLOR to the opening FONT tag and assign it a value for the color. The color value can be any of the following 16 color names: black, silver, white, gray, maroon, red, blue, green, yellow, purple, fuchsia, cyan, lime, olive, navy, teal, aqua. Instead of the color names, you can also use the hexadecimal numbers for the colors, which are specified according to the RGB value for each color. The hexadecimal numbers must be prefixed by the "#" sign. Examples: #000099 for dark blue or #FFFF99 for a faint yellow. (iii) Different Fonts: To change the font style from the default (Times New Roman) to a different style, simply add the attribute FACE to the opening FONT tag. As value for the FACE attribute we can use any specific font name such as "verdana", "arial", "georgia", "bookman old style", "comic sans ms" and many more. Alternatively you may use generic font styles such as "serif", "sans-serif", "cursive", "fantasy" and "monospace". The font face values are case- insensitive, i.e. it doesnt matter whether we type "Arial" or "arial". Example

Output

Assignment 3: Explain image Tag in HTML. Solution: The HTML element used for this inserting graphics and pictures is IMG. It is neither empty (stand-alone) element, which means that it only has an opening tag and neither content nor a closing tag. There are at least two attributes we need to include inside the image tag: The SRC (source) attribute which points to the location of the image ALT (alternative text) attribute, which contains the text that is displayed instead of an image in text-only browsers or in cases where the image is not available. Heres the basic HTML code to insert images into web pages. <img src="path/to/image" alt="alternative text"> The value for the source attribute is the path to the image file relatively to the location of the current document. For example: the file name of the image you want to insert is "picture.jpg" and its stored inside the same folder as your webpage, then the path would be simply the filename only: picture.jpg If the image is stored in a subfolder named "images", then the path to the image file would be: images/picture.jpg. And finally, if the image is stored in a parent folder, the path to it would be: ../picture.jpg The Attributes WIDTH and HEIGHT These two attributes which specify the width and the height of an image are sometimes pretty useful. In case an image is not available or when users have the image display disabled in their browsers, the width and the height attribute define a white box in the size of the image, thus preserving the formatting of the remaining webpage. Otherwise, the size of this box would be determined by the alternative text for the image. The BORDER Attribute With the BORDER attribute inside an image tag you can add a black border around an image. The border thickness is defined by the value of the border attribute, which may take any integer number. For example: for a 5 pixels thick border you would use border="5". The most important use for the border attribute is when the image is used as hyperlink.

Example

Output

Assignment 4: Explain the use of Hyperlink Tag in HTML. Solution: The HTML <a> tag defines a hyperlink. A hyperlink (or link) is a word, group of words, or image that we can click on to jump to another document. When we move the cursor over a link in a Web page, the arrow will turn into a little hand.The most important attribute of the <a> element is the href attribute, which indicates the links destination. By default, links will appear as follows in all browsers:

An unvisited link is underlined and blue A visited link is underlined and purple An active link is underlined and red

HTML Link Syntax The HTML code for a link is simple. It looks like this: <a href="url">Link text</a> The href attribute specifies the destination of a link. Example <a href="http://www.google.com/">Search Engine</a> HTML Links - target Attribute The target attribute specifies where to open the linked document. The example below will open the linked document in a new browser window or a new tab: Example <a href="http://www.google.com/" target="_blank">Search Engine</a> HTML Links - The id Attribute The id attribute can be used to create a bookmark inside an HTML document.

Example

Output

After clicking on link Search Engine in above page the page look like as:

Assignment 5: Explain the use of List Tag in HTML. Solution: The most common HTML lists are ordered and unordered lists: HTML Unordered Lists An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.The list items are marked with bullets (typically small black circles). HTML Ordered Lists An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.The list items are marked with numbers. HTML Definition Lists A definition list is a list of items, with a description of each item.The <dl> tag defines a definition list.The <dl> tag is used in conjunction with <dt> (defines the item in the list) and <dd> (describes the item in the list): Example

Output

Assignment 6: Explain the use of Table in HTML Solution: Tables are defined with the <table> tag. A table is divided into rows (with the <tr> tag), and each row is divided into data cells (with the <td> tag). The letters td stands for "table data," which is the content of a data cell. A data cell can contain text, images, lists, paragraphs, forms, horizontal rules, tables, etc. Tables and the Border Attribute If we do not specify a border attribute the table will be displayed without any borders. Sometimes this can be useful, but most of the time, we want the borders to show. To display a table with borders, we will have to use the border attribute. Headings in a Table Headings in a table are defined with the <th> tag. Example

Output

Das könnte Ihnen auch gefallen