Pages

Friday, May 24, 2013

html fundamentals questions with answers?

Introduction to HTML:
1.HTML developed by W3ORG (word word word organization)
2.&nbps,&nbps ...:used for space between two line
3.<head><title>wecome</title></head>  //used for heading
4.<lable id ="lbname" >Nmae:</lable>  //in oreder to display plain text ,it is better to use label text.
5.<link rel ="stylesheet" type="text/css" href="filename.css">  //link html file to css file.
6.align is used for which postion u want to place ur text like left ,right...

1.What is HTML?

HTML is a language for describing web pages.
  • HTML stands for Hyper Text Markup Language
  • HTML is a markup language
  • A markup language is a set of markup tags
  • The tags describe document content
  • HTML documents contain HTML tags and plain text
  • HTML documents are also called web pages. 

2.HTML Tags

HTML markup tags are usually called HTML tags
  • HTML tags are keywords (tag names) surrounded by angle brackets like <html>
  • HTML tags normally come in pairs like <b> and </b>
  • The first tag in a pair is the start tag, the second tag is the end tag
  • The end tag is written like the start tag, with a forward slash before the tag name
  • Start and end tags are also called opening tags and closing tags

3.Writing HTML Using Notepad or TextEdit

HTML can be edited by using a professional HTML editor like:
  • Adobe Dreamweaver
  • Microsoft Expression Web
  • CoffeeCup HTML Editor.

4.HTML Links

HTML links are defined with the <a> tag
 <a href="http://www.w3schools.com">This is a link</a>

5.HTML Images

HTML images are defined with the <img> tag.
<img src="imagename.jpg" width="104" height="142">

6.The HTML <style> Element

The <style> tag is used to define style information for an HTML document.
Inside the <style> element you specify how HTML elements should render in a browser:
how to write:
<head>
<style type="text/css">
body {background-color:yellow}
p {color:blue}
</style>
</head>

7.HTML Style Example - Background Color

The background-color property defines the background color for an element:
<body style="background-color:yellow;">
<input type ="buttom" id ="btnbuttom" value="submit" style="background-color:black;color:white">

8.HTML Tables:

<table border="1">
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>

9.HTML Table Headers

Header information in a table are defined with the <th> tag.
All major browsers display the text in the <th> element as bold and centered.
<table border="1">
<tr>
<th>Header 1</th>
<th>Header 2</th>
</tr>
<tr>
<td>row 1, cell 1</td>
<td>row 1, cell 2</td>
</tr>
<tr>
<td>row 2, cell 1</td>
<td>row 2, cell 2</td>
</tr>
</table>

10.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).
<ul>
<li>Coffee</li>
<li>Milk</li>
</ul>

11.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
<ol>
<li>Coffee</li>
<li>Milk</li>
</ol>

12.The HTML <div> Element

The HTML <div> element is a block level element that can be used as a container for grouping other HTML elements.
 The <div> element has no special meaning. Except that, because it is a block level element, the browser will display a line break before and after it.
When used together with CSS, the <div> element can be used to set style attributes to large blocks of content.
Another common use of the <div> element, is for document layout. It replaces the "old way" of defining layout using tables. Using <table> elements for layout is not the correct use of <table>. The purpose of the <table> element is to display tabular data.
Example:

<!DOCTYPE html>
<html>
<body>

<div id="container" style="width:500px">
<div id="header" style="background-color:#FFA500;">
<h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>

<div id="menu" style="background-color:#FFD700;height:200px;width:100px;float:left;">
<b>Menu</b><br>
HTML<br>
CSS<br>
JavaScript</div>
<div id="content" style="background-color:#EEEEEE;height:200px;width:400px;float:left;">
Content goes here</div>
<div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">
Copyright © http://pravatdotnet.blogspot.in/</div>
</div>
</body>
</html>

13.HTML Forms and Input

 1.For TextBox:               Username: <input type="text" name="user"><br>
2.For Text in psd format: Password: <input type="password" name="password">
3.For Radio Button:        <input type="radio" name="sex" value="male">Male<br>
4.For CheckBox:           <input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
5.For TextArea:            <textarea rows="10" cols="30">
6.Text and inside comment: <input type="text" name="name" value="your name"><br>
7.
14.How to create a drop-down list with a pre-selected value
<form action="">
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat" selected>Fiat</option>
<option value="audi">Audi</option>
</select>

15.HTML Iframes 

An iframe is used to display a web page within a web page
Syntax for adding an iframe:
<iframe src="URL"></iframe>

<iframe src="demo_iframe.htm" width="200" height="200"></iframe> 
Target to a link: 
<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p><a href="http://www.w3schools.com" target="iframe_a">W3Schools.com</a></p>

No comments:

Post a Comment