III. Practice: Use Visual Studio Code to start an off platform project
As you move through various lessons and paths here on Codecademy, you may find yourself needing to create a project on your own computer and not on the Codecademy learning environment. This can be tricky, but it’s an exciting step that signals that you are ready to work independently.
To do this, we’ll need to use the text editor we installed above. Let’s take a moment to try out Visual Studio Code.
Go further with Visual Studio Code’s features
If you already feel comfortable with the previous steps, explore the following features to further customize your development environment. You don’t need to use these suggestions to complete the projects on Codecademy but they can help make you more efficient when writing code and are what make Visual Studio Code such a useful editor!
Congratulations! You’ve successfully set up your text editor and are ready to create websites on your own computer.
'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'
Offenbar hast du diese Funktion zu schnell genutzt. Du wurdest vorübergehend von der Nutzung dieser Funktion blockiert.
Wenn dies deiner Meinung nach nicht gegen unsere Gemeinschaftsstandards verstößt,
Cách tạo một file trong VSCode
Các bạn nhấp chuột phải vào vùng trống ở trong thư mục mà chúng ta đã đưa vào VSCode. Sau đó các bạn chọn New File:
Tiếp theo chúng ta sẽ đặt tên cho file mới này. Có một số lưu ý về đặt tên các bạn cần nhớ như sau:
Ở đây chúng mình sẽ đặt tên file là "index" với phần đuôi mở rộng là ".html" để máy tính nhận diện được đây là file HTML.
Comment trong file HTML trên VSCode có tác dụng giúp chúng ta ghi chú lại tác dụng của một đoạn code. Để comment được trong file HTML thì các bạn sẽ bôi đen đoạn code, sau đó bấm giữ tổ hợp phím tắt Ctrl + ? nhé. Sau đó các bạn chỉ cần nhập comment vào để phân biệt tác dụng của các đoạn code.
Langkah 4: Menyimpan dan melihat perubahan
Setiap kali kamu melakukan perubahan pada file HTML kamu, pastikan kamu menyimpan perubahan tersebut dengan memilih File dan klik Save. Untuk melihat perubahan tersebut, kamu bisa membuka file HTML dengan peramban web. Cukup klik kanan file HTML di explorer lalu pilih Open with Live Server.
Itulah cara membuat HTML di Visual Studio Code. Semoga artikel ini membantu kamu untuk memulai pengembangan web menggunakan VS Code. Selamat mencoba!
Selamat datang di aplikasi HTML Code Play untuk belajar coding. Aplikasi HTML ini adalah pembelajaran pemrograman gratis dan aplikasi offline HTML yang digunakan untuk mempelajari desain dan pemrograman web. Aplikasi bermain kode HTML dibuat untuk mengajarkan pengembangan web (HTML, CSS, javascript). Aplikasi HTML berisi fitur-fitur seperti Editor HTML dan penampil offline, editor CSS, editor kode javascript, editor bootstrap, dan editor angular js. Aplikasi bermain kode HTML ini terutama digunakan untuk mengajarkan cara membuat situs web menggunakan alat pengembangan web seperti tag dan atribut HTML, kode HTML CSS dan properti CSS, pemrograman javascript, program jquery, bootstrap, knockout js. Selain itu, kita dapat menggunakan aplikasi ini sebagai pengganti notepad untuk HTML, notepad++, dan tanda kurung HTML. Ini adalah aplikasi pengkodean HTML terbaik di play store. Kami dapat menggunakannya untuk seluruh Pembuat/Penguji HTML HTML aplikasi pemrograman.Aplikasi penampil HTML berfokus terutama untuk mengajar pemrogram pemula dan siswa yang perlu mempelajari pengembangan web. Aplikasi pengkodean HTML ini dapat mempertimbangkan buku HTML. Ini berisi tutorial HTML dan CSS dengan contoh, program javascript dengan output sampel, program jquery, dan contoh jquery, tutorial bootstrap offline.Pembuatan situs web itu mudah. Tetapi banyak programmer HTML baru mungkin merasa sulit untuk mempelajari kode HTML, tag, dan CSS, dengan belajar dari situs web lain karena contoh yang sulit. Tutorial pemrograman web HTML tersebut tidak dimulai dengan tag HTML dasar dengan contoh untuk membuat Anda memahami apa yang sebenarnya dilakukan oleh tag tersebut. Tetapi aplikasi HTML Code Play adalah aplikasi pembelajaran HTML yang memiliki tutorial html5 sederhana dengan contoh-contoh yang berisi HTML semua tag yang menjelaskan dengan kata-kata sederhana bagaimana tag HTML properti CSS, pemrograman javascript, program jQuery, knockout js, bootstrap bekerja. Fitur terbesar aplikasi bermain kode HTML ini adalah mempelajari HTML secara offline.Pengembang situs web harus tahu tentang HTML, CSS, dan javascript. Ada banyak aplikasi desain dan pemrograman web, tetapi kami mencoba menonjol dari mereka dengan mengetahui siapa yang perlu belajar mendesain web secara offline atau siapa yang perlu menjadi perancang web dan kami membuat editor HTML dan CSS sehingga seseorang dapat membuat Situs Web HTML mereka sendiri halaman inspektur.Dengan menggunakan aplikasi pengembangan web HTML Code Play ini kita dapat mempelajari Dasar-dasar HTML, tutorial HTML, tutorial CSS, tutorial javascript, tutorial jquery, tutorial belajar knockout js.Fitur HTML-Editor HTML untuk Android – Editor HTML berisi editor sehingga seseorang dapat memasukkan kodenya sendiri, menjalankan, dan melihat hasilnya.-HTML offline - Aplikasi ini adalah aplikasi offline tutorial HTML sehingga seseorang dapat mempelajari HTML dasar secara offline.-Inspektur HTML - Mirip dengan elemen inspeksi di browser, seseorang dapat memeriksa dan memperbaiki kesalahan dengan mudah.-dasar-dasar HTML - Berisi tutorial dan contoh tag HTML seperti tabel HTML, tag input, dan banyak lagi.-Peramban HTML - Keluaran yang dihasilkan dari tutorial akan sama dengan hasil di peramban.tag -html5 - Aplikasi ini juga berisi tag yang kompatibel dengan html5.Aplikasi editor HTML ini adalah aplikasi HTML terbaik yang juga mendukung View & Edit Website HTML viewer dan output. Penulis HTML membantu Anda menulis kode HTML Anda.Kita dapat mempelajari HTML video YouTube mengintegrasikan menggunakan program HTML.Fitur CSS-CSS code viewer – CSS code viewer berisi editor untuk memasukkan kode CSS dan memeriksa outputnya.-Aplikasi offline tutorial CSS - Berguna agar seseorang dapat offline Belajar CSS dengan editor.-CSS properties - CSS digunakan untuk mempelajari CSS dan membuat kode CSS HTML dan situs web.Ini adalah aplikasi pembelajaran bermain kode HTML yang juga digunakan untuk mempelajari tutorial HTML Penulis secara offline penuh dan semua tag html5 belajar secara gratis. Aplikasi ini adalah aplikasi pengkodean HTML dan CSS yang sangat terkenal.Aplikasi belajar HTML ini untuk membantu Anda menyimpan penampil dokumen HTML nanti. Aplikasi ini berisi banyak contoh HTML, contoh CSS, dan lebih banyak contoh terkait pengembangan situs web yang diberikan.
HTML là gì? Lập trình HTML là gì? Hãy cùng chúng mình tìm hiểu ngay về HTML và cách chạy file HTML trong Visual Studio Code hiệu quả trong bài viết ngay dưới đây các bạn nhé.
HTML (Hypertext Markup Language) là một loại ngôn ngữ đánh dấu siêu văn bản. HTML được tạo ra để xây dựng hoặc cấu trúc lại một website. HTML giúp chúng ta chuyển đổi từ một văn bản bình thường hoặc một file thiết kế thành một trong giao diện website. HTML sẽ quản lý những nội dung này dưới dạng có thẻ với 3 loại cơ bản là:
Hầu hết các trang Web mà bạn đang lướt hàng ngày được bố cục và định dạng bởi HTML. Để học được cách dùng HTML thì các bạn phải sử dụng một trình soạn thảo có tên là Visual Studio Code (sau đây sẽ gọi tắt VSCode). Giao diện của trình soạn thảo nào có dạng như sau:
Bây giờ chúng ta sẽ tạo ra một thư mục trống rồi mở nó lên trong VSCode. Cách tạo rất đơn giản mà bạn nào cũng biết là bấm chuột phải => chọn New Folder => đặt tên cho thư mục rồi bấm Enter. Sau đó các bạn chỉ cần kéo thư mục đã tạo vào VSCode, phần mềm sẽ tự động mở nó lên cho bạn:
Trên đây là những kiến thức cơ bản về HTML và VSCode. Chúng ta sẽ cùng tìm hiểu chi tiết hơn trong phần sau của nội dung bài viết này các bạn nhé.
Xem thêm: Hướng dẫn cách chuyển đổi bảng Excel sang HTML
What are ‘text editors’?
Text editors, also called code editors, are applications used by developers to write code. They can highlight and format your code so that it’s easier to read and understand. If you’ve used Codecademy, you’re already familiar with a text editor. It’s the area you write your code in.
Using a text editor is part of creating your “development environment,” the set of tools that you use for working on coding projects. It will allow you to take what you’ve learned on Codecademy and put it into practice as you work on projects on your computer. Not only will this introduce you to tools that are commonly used by professional developers but it also means that you’ve grown as a developer and are ready to start working on your own—great work!
Specific to writing code, text editors provide a number of advantages:
You may also have read or heard about IDEs, or “integrated development editors.” An IDE allows you to not only edit, but also compile, and debug your code through one application or interface. While the text editor we recommend isn’t considered an IDE, it has many IDE-like features that make life as a developer easier without needing a lot of resources that an IDE usually requires. The best of both worlds!
II. Installing Visual Studio Code
So, we’ve chosen our text editor, now we just need to install it on our computer!
For the visual learners, this video details how to download and install Visual Studio Code. Written instructions are below.
The installation process for computers running macOS, Windows, and Linux, (specifically Ubuntu and Debian), will be very similar and using Visual Studio Code across all of them will be the same.
Visit the Visual Studio Code website to download the latest version of Visual Studio Code.
You should see your computer’s operating system displayed, but if it’s not correct, click on the down arrow and find the option that matches your operating system from the drop down menu and click on the down arrow icon under “Stable.”
Windows users: This will download the latest version of Visual Studio Code as an .exe file.
Mac users: This will download the latest version of Visual Studio Code for Mac as a .zip file.
Linux users: .deb and .rpm are different file types for storing data. We suggest you download the .deb file so auto-updates work as the Visual Studio Code documentation suggests.
Once the Visual Studio Code file is finished downloading, we need to install it. Find the Visual Studio Code file in your file manager, the program that lets you see the files and folders on your computer.
Windows users: Open the .exe file by clicking on it and on run the installer. Keep clicking ‘Next’ and then finally ‘Finish.’
Mac users: The downloaded .zip file should be in your ‘Downloads’ folder. Open the file. If you see this message choose “Open.”
Linux users: The downloaded file should be in your ‘Downloads’ folder.
Find it in your file manager, double click and choose ‘Install’ in the GUI software center, or run the following commands, one at a time, in the terminal:
Make sure you have your Visual Studio Code application saved in a place you know you will easily be able to find it.
Windows users: It will automatically be placed in your Start menu.
Mac users: Click and drag the Visual Studio Code icon from the Downloads folder to the Applications folder.
Linux users: It should appear in your task bar of programs.
That’s it, you’ve successfully installed your text editor and are ready to start coding!
Hướng dẫn cách sử dụng VSCode
Practice: Let’s make a project
Below are the steps you need to follow to create a new folder for all of your programming projects. You will also learn how to load a new project folder into Visual Studio Code and make your very first “hello world” HTML project.
We’d recommend that you watch the above video and then follow the written steps below.
Navigate to a folder using your file manager or the terminal. Make sure it is a folder you visit regularly and will remember. Create a new folder called projects.
Mac users: This may be your User account or “Home” folder.
Windows users: You may want to save this on your C drive.
Linux users: You may want to save this in your User folder inside of the “Home” folder.
Inside the projects folder, create a new folder called HelloWorld. Everything you add to this folder will be part of your HelloWorld project.
Click on the ‘Explorer’ icon on the left hand menu and click on the button ‘Open Folder’ and choose your development folder. This will launch your file manager.
Navigate to the HelloWorld folder and select Open. The folder will open in Visual Studio Code’s side pane. At this point, there should not be any contents in the folder. We’ll add a file in the next step.
Before you learn how to add files to a project folder, it is important to understand the purpose of file extensions. A file extension is the suffix of a filename (the last 3 or 4 characters in a filename, preceded by a period) and describes the type of content the file contains. For example, the HTML file extension is .html, and it tells the browser (and other applications) to interpret the contents of the file as an HTML document. Once Visual Studio Code loads a project folder, you can add files. The steps below describe how to add files. Don’t worry about doing this on your own computer. We’ll get to that next.
In Visual Studio Code’s Explorer pane, click on your development folder’s name. You’ll see four icons appear to the right of the folder name. Click the ’New File’ icon. Type the new file’s name with its appropriate file extension ( for example, .html, .css, .csv). It is critical that you include the correct file extension, so programs like linters know how to interpret its contents. Press Enter when done.
Copy and paste the following boilerplate HTML code:
Save your file often with the Auto Save feature and track changes with a version control system if you know how to use one. (To turn Auto Save on, click on ‘File’ then ‘Auto Save’. When it’s on, you’ll see a check mark next to ‘Auto Save’.) This will decrease the chances of losing unsaved work.
File Extensions and Syntax Highlighting
Syntax is the set of rules that tell us how to create correctly written code. Visual Studio Code and other text editors are able to interpret file extensions and provide language-specific syntax highlighting. Syntax highlighting is a tool for making code easier to read. Take a look at your index.html file. The text and tags are different colors. This is how Visual Studio Code highlights .html syntax. With each new language you learn, Visual Studio Code will highlight text in a way that makes your code easy to read. This may be different than other text editors and also different than the way your code is highlighted on Codecademy.
Optional: Change the color scheme
Although Visual Studio Code comes with default syntax highlighting, you may want to change the colors used. Good color themes will make reading all those lines of code easy on your eyes. (Try out low contrast, dark themes like “Solarized Dark” or “Dracula Dark.”)
To do this, select Color Theme from the Welcome page when you first open Visual Studio Code, or click on Code in the menu bar at the top of your desktop window, then click on Preferences, followed by Color Theme. You can also search for color themes to install using the Extensions menu .
At this point, your file is ready to be viewed in a web browser. The following steps should be taken outside of Visual Studio Code:
Navigate to the index.html file in your Hello World folder through your file manager or terminal.
Double click or open index.html. The page should open in your default web browser. Take second to marvel at your handiwork—you made your first project with Visual Studio Code.
Langkah 2: Membuat file HTML baru
Setelah Visual Studio Code berhasil diinstall, kamu bisa mulai membuat file HTML. Berikut ini adalah langkah-langkah yang bisa kamu ikuti:
Sekarang kamu sudah punya file HTML, maka bisa mulai untuk menulis kode. Berikut adalah struktur dasar dari HTML:
Untuk memulai, kamu bisa menyalin struktur di atas ke dalam file HTML kamu di Visual Studio Code serta melakukan modifikasi sesuai kebutuhan.
Langkah 1: Download dan Install Visual Studio Code
Sebelum kamu dapat mulai menulis kode HTML, kamu harus memiliki Visual Studio Code di komputer kamu. Kamu bisa mendapatkannya secara gratis dari situs web resmi Microsoft. Setelah mendownload, ikuti saja instruksi yang diberikan untuk menginstall aplikasi ini di komputer kamu.