How do i save html source code?


A simple text editor is all you need to learn HTML.


Learn HTML Using Notepad or TextEdit

Web pages can be created and modified by using professional HTML editors.

However, for learning HTML we recommend a simple text editor like Notepad (PC) or TextEdit (Mac).

We believe that using a simple text editor is a good way to learn HTML.

Follow the steps below to create your first web page with Notepad or TextEdit.


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 the following HTML code into Notepad:

<!DOCTYPE html>
<html>
<body>

<h2>My First Heading</h2>

<p>My first paragraph.</p>

</body>
</html>

How do i save html source code?



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).

How do i save html source code?

Tip: 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:

How do i save html source code?


W3Schools Online Editor - "Try it Yourself"

With our free online editor, you can edit the 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>

<h2>This is a Heading</h2>
<p>This is a paragraph.</p>

</body>
</html>

Try it Yourself ยป

Click on the "Try it Yourself" button to see how it works.


W3Schools Spaces

If you want to create your own website and save your code online, try our free website builder, called W3schools Spaces:


I want to download all files (html, images, js, css) from one website. I can download each and every file separately.

I tried in Google Chrome, after clicking on the view source, then ctrl + s then saved as sample.html then I got one sample.html and also one sample folder contains all files like css, js, images etc. But again I am trying to do the same, but it's not.

So earlier how it works? Why is it not working now?

Note: It's only for study purpose, not for copying any website of web contents.

How do i save html source code?

asked Jul 26, 2012 at 5:27

5

Try Winhttrack

...offline browser utility.

It allows you to download a World Wide Web site from the Internet to a local directory, building recursively all directories, getting HTML, images, and other files from the server to your computer. HTTrack arranges the original site's relative link-structure. Simply open a page of the "mirrored" website in your browser, and you can browse the site from link to link, as if you were viewing it online. HTTrack can also update an existing mirrored site, and resume interrupted downloads. HTTrack is fully configurable, and has an integrated help system.

WinHTTrack is the Windows 2000/XP/Vista/Seven release of HTTrack, and WebHTTrack the Linux/Unix/BSD release...

gnat

6,179104 gold badges53 silver badges72 bronze badges

answered Jul 26, 2012 at 5:47

In Chrome, go to options (Customize and Control, the 3 dots/bars at top right) ---> More Tools ---> save page as

save page as  
filename     : any_name.html 
save as type : webpage complete.

Then you will get any_name.html and any_name folder.

Donald Duck

7,86120 gold badges70 silver badges91 bronze badges

answered Jul 26, 2012 at 6:01

How do i save html source code?

PrashobhPrashobh

8,88614 gold badges59 silver badges90 bronze badges

2

How do I save HTML code as a file?

Save a document in HTML format.
Choose File > Save As and choose HTML from the drop-down list..
Give the filename an extension of . html, specify the file location, and click Save. ... .
Open the HTML file in a Web browser to examine the converted file. If it meets with your approval, you are done..

How do I save the HTML code for a website?

How to save a web page in HTML format.
Navigate to the web page, right-click on the page and select Save as....
Select or create a new folder to save the file, images, and associated items from the web page..
Enter a file name and select Webpage, Complete (*. htm;*html) for the Save as type..
Click the Save button..

Where do I save HTML files?

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).