how to program html????
Answers
Answer:
what is HTML ?
HTML is a basic web language used to design websites.
so now let us see where we write a program in html:
go to your start button and search for notepad and open it. notepad is the place to make a HTML code.
now as we have opened notepad , let us come to coding.
every html programme contains a <html> tag
followed by <head> tag
under head tag,
we add title with a <title> tag.
remember that you should end every tag
then end title with </title> tag
then end the </head> tag
then open the <body> tag
type your content in it
then close the body tag with</body>
now end the html with </html> tag
the below is a small coding,
<html>
<head>
<title>a basic structure</title>
</head>
<body>
a basic code in html consists of html tag,head tag,title tag,body tag.
</body>
</html>
this has to be saved as with a html extension.
for example i am saving it as ram, then it is ram.html
then you can save it in desktop,
then you can see the output of your html code
now i will say the codings for more things:
- we can insert background colour of red if i want red using <bg color = "red">
- HTML includes six levels of headings, which are ranked according to importance.
These are <h1>, <h2>, <h3>, <h4>, <h5>, and <h6>.
- To create a paragraph, simply type in the <p> element with its opening and closing tags:
- HTML documents consist of nested HTML elements. the body element includes the <p> tags, the <br /> tag and the content.
- if my image is saved as image in the form of jpeg then i can use <img src="image.jpg" />
- for linking use <a href=" your file name.html"></a>
- an ordered list starts with <ol> tag and an unordered list starts with <ul> tag
the attachment is the output of above coding
Step 1: Open Notepad (PC)
Windows 8 or later:
Open the Start Screen (the window symbol at the bottom left on your screen). Type Notepad.
Windows 7 or earlier:
Open Start > Programs > Accessories > Notepad
Step 1: Open TextEdit (Mac)
Open Finder > Applications > TextEdit
Also change some preferences to get the application to save files correctly. In Preferences > Format > choose "Plain Text"
Then under "Open and Save", check the box that says "Display HTML files as HTML code instead of formatted text".
Then open a new document to place the code.
Step 2: Write Some HTML
Write or copy some HTML into Notepad.
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
Notepad
Step 3: Save the HTML Page
Save the file on your computer. Select File > Save as in the Notepad menu.
Name the file "index.htm" and set the encoding to UTF-8 (which is the preferred encoding for HTML files).
View in Browser
You can use either .htm or .html as file extension. There is no difference, it is up to you.
Step 4: View the HTML Page in Your Browser
Open the saved HTML file in your favorite browser (double click on the file, or right-click - and choose "Open with").
The result will look much like this:
View in Browser
W3Schools Online Editor
With our free online editor, you can edit HTML code and view the result in your browser.
It is the perfect tool when you want to test code fast. It also has color coding and the ability to save and share code with others:
Example
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>