Categories
HTML

First look at HTML

HTML is used to feed the content on the web page or web application.

HTML = content.

HTML is not used for styling the page if you want to style then you need to use CSS.

HTML ≠ style. CSS = style.

HTML Document Structure

All HTML document must start with <html> and end with </html>.

<body> … </body> body tag is where the content is entered and visible in the browser.

<!DOCTYPE HTML>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p>

</body>
</html>

If you don’t know how to run this code you can use this link and follow the steps.

HTML Headings :

  • <h1> </h1> tags are used to define the headings.
  • heading tags vary from <h1> to <h6>.
  • <h1> with the larger size and the size reduce when the number increases till <h6>.
<html>
<body>

<h1> This is h1 element </h1>
<h2> This is h2 element </h2>
<h3> This is h3 element </h3>
<h4> This is h4 element </h4>
<h5> This is h5 element </h5>
<h6> This is h6 element </h6>

</body>
</html>

you can copy paste this code and run it using editor.

HTML Paragraph:

<p> tags are used to define the HTML paragraph.

<html>
<body>

<p> This is an paragraph </p>
<p> this is an second paragraph </p>

</body>
</html>

you can copy paste this code and run it using editor.

Categories
HTML Web Development

How to run an HTML file?

Many modern editors are available to create and modify web pages. But we recommend using simple editors like Notepad (windows) and Textedit (Mac).

How to open Notepad in windows?

Open start and type notepad at search.

(OR)

Open Start > Programs > Accessories > Notepad.

How to open Textedit in Mac?

press command + space enter Spotlight search will appear and type Textedit in that search.

(OR)

Open Finder > Applications > TextEdit

For mac, we recommend installing sublime text https://www.sublimetext.com/3

Let’s get started!

<html>
<header><title> This is title </title> 
</header>
<body>
Hello world
</body>
</html>

Copy the above code and past it the Notepad (or) Textedit.

Select File > Save as

Name the file as index.html. all HTML files should be in <filename>.html format.

Double click on the file, or right-click – and choose “Open with” and select your preferred browser.

the output may look like this.