What is an HTML File?

  • HTML stands for Hyper Text Markup Language
  • An HTML file is a text file containing small 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

  • Do You Want to Try It?

    If you are running Windows, start Notepad.

    If you are on a Mac, start SimpleText.

    In OSX start TextEdit and change the following preferences: Open the the "Format" menu and select "Plain text" instead of "Rich text". Then open the "Preferences" window under the "Text Edit" menu and select "Ignore rich text commands in HTML files". Your HTML code will probably not work if you do not change the preferences above!

    Type in the following text:

    This is my first homepage. This text is bold

    Save the file as "mypage.htm".

    Start your Internet browser. Select "Open" (or "Open Page") in the File menu of your browser. A dialog box will appear. Select "Browse" (or "Choose File") and locate the HTML file you just created - "mypage.htm" - select it and click "Open". Now you should see an address in the dialog box, for example "C:\MyDocuments\mypage.htm". Click OK, and the browser will display the page.


    Example Explained

    The first tag in your HTML document is . This tag tells your browser that this is the start of an HTML document. The last tag in your document is . This tag tells your browser that this is the end of the HTML document.

    The text between the tag and the tag is header information. Header information is not displayed in the browser window.

    The text between the

    The text between the tags is the text that will be displayed in your browser.

    The text between the and tags will be displayed in a bold font.


    HTM or HTML Extension?

    When you save an HTML file, you can use either the .htm or the .html extension. We have used .htm in our examples. It might be a bad habit inherited from the past when some of the commonly used software only allowed three letter extensions.

    With newer software we think it will be perfectly safe to use .html.

    Note on HTML Editors:

    You can easily edit HTML files using a WYSIWYG (what you see is what you get) editor like FrontPage or Dreamweaver, instead of writing your markup tags in a plain text file.

    However, if you want to be a skillful Web developer, we strongly recommend that you use a plain text editor to learn your primer HTML.



    Q: After I have edited an HTML file, I cannot view the result in my browser. Why?
    A:
    Make sure that you have saved the file with a proper name and extension like "c:\mypage.htm". Also make sure that you use the same name when you open the file in your browser.

    Q: I have edited an HTML file, but the changes don't show in the browser. Why?
    A:
    A browser caches pages so it doesn't have to read the same page twice. When you have modified a page, the browser doesn't know that. Use the browser's refresh/reload button to force the browser to reload the page.

    Q: What browser should I use?
    A:
    You can do all the training with all of the well-known browsers, like Internet Explorer, Firefox, Netscape, or Opera. However, some of the examples in our advanced classes require the latest versions of the browsers.

    Q: Does my computer have to run Windows? What about a Mac?
    A:
    You can do all your training on a non-Windows computer like a Mac.

    INTRODUCTION TO DHTML:

    DHTML stands for Dynamic Hyper Text Markup Language. It is also a scripting language that is used for developing attractive and catchy web pages. With the help of DHTML we can combine html with cascading style sheets and other scripting languages. “css” feature in DHTML is used to determine an element ‘s size color, position and a number of other features. The working of DTHML is same as that of html that is writing the coding in the notepad and saving the document as html file.

    Cascading Style Sheets:

    Cascading style sheets allow you to specify the style of your page element (font, spacing, margin, etc) separated from the structure of your document (section header, body text, links, etc). Cascading style sheets enforce standards and uniformity throughout a web site and provide numerous attributes to create dynamic effects. Css can make global changes to all documents from a single location.

    This separation of structure from content allows greater manageability and makes changing the style of your document easier. The style assigned process is accomplished with the tags. Between the tags are written within the ….tags.

    Syntax:-

    ØDesign A Web Page Using Cascading Style Sheet:



    Vision 2000

    Computer Education

    Authorised software user of Microsoft

    Output Of The Web Page:

    The SPAN Tag:

    …….. TAG:-

    SPAN is a generic grouping element it doesn’t apply any inherent formatting to it s contents SPAN tag plays a prominent role in style sheets its main use is to apply styles or ID attribute to a block of text.

    It is displayed inline a so called in line – level element with other text. With no liner breaks a similar element is the div element.

    In the body of the document ……..is used to set the boundaries of the rules styling specifications.

    ØDesign A Web Page Using SPAN Tag:

    Garments Sale

    We are giving a sale on all types of garments. You will get here suits, shirts, pants, jeans, cotton pants, leather jackets, T-shirts, casual wear, sarees, salwar suits etc.

    Special offer for Children

    For childrens you will get a huge range of collection of frocks, pants, shirts, T-shirts, Baba-suit, gallies, ghagra, churidars etc. We are offering 10% discount if the purchase price is more than Rs.500.

    Winter Special

    Under one roof we are giving sale for winter garments too. Shawls, sweater, woolen jackets, blankets are available.

    Output Of The Web Page:

    The DIV Tag:

    …..
    TAG

    A similar element is the div tag element which also applies no inherent style, but is displayed on its online with margins above and below also called block level element a web page can be divided into segments or divisions called DIV’s. Each segment starts with div and ends with div these segments can be positioned anywhere on the page. The DIV tag has a position attribute that can take one of the two values, which are absolute or relative position the segment with respect to the top/ left edge of the browser window. In contrast with the absolute, relative position the segment in relation to the other element on the page.

    ØDesign A Web Page Using DIV Tag:

    Each segment starts with div and ends with div these segments can be positioned anywhere on the page. The DIV tag has a position attribute that can take one of the two values, which are absolute or relative position the segment with respect to the top/ left edge of the browser window.

    Each segment starts with div and ends with div these segments can be positioned anywhere on the page. The DIV tag has a position attribute that can take one of the two values, which are absolute or relative position the segment with respect to the top/ left edge of the browser window.

    Each segment starts with div and ends with div these segments can be positioned anywhere on the page. The DIV tag has a position attribute that can take one of the two values, which are absolute or relative position the segment with respect to the top/ left edge of the browser window.

    Output Of The Web Page:

    ØBORDER Attribute:

    The border lies between the padding space and the margin space, and has numerous properties to adjust its appearance.

    • Design A Web Page Using BORDER Attribute:


    This text has a thick groove border


    MEDIUM GROOVE”>This text has a medium groove border


    This text has a thin groove border

    CLASS=”THIIN BLUE INSET”>This text has a thin blue inset border


    <P CLASS=”MEDIUM BLUE OUTSET”>This text has a medium blue outset border


    Output Of The Web Page:

    Note: - Keep in mind that the BORDER styles are available only for Macintosh systems.

    The LIST Tag:

    We can also create list in DHTML. Following are the attributes that can be specified with list.

    ØDesign A Web Page Using LIST Tag:

    Syllabus for 1st semister

    Dear Students

    We wish you all the best for your 1st semister exam. We are giving you the syllabus details and we going to declare the exam date on 25thNovember 2001.