avatarHermantoXYZ

Summary

The website provides a step-by-step guide on creating a basic HTML webpage with optional CSS styling using Visual Studio Code, without the need for backend development.

Abstract

The guide begins with instructing users to install Visual Studio Code and then proceeds to detail the process of creating a new HTML file within the editor. It includes a visual example of how to create a new file and provides a sample HTML structure with essential elements such as doctype, html, head, body, header, nav, main, section, and footer. The guide also explains how to save the HTML file with a .html extension and suggests creating a style.css file for styling purposes. It concludes by demonstrating how to link the CSS file to the HTML document to apply custom styles and emphasizes that the resulting webpage is functional without any backend components.

Opinions

  • The guide implies that Visual Studio Code is a preferred or recommended tool for web development, especially for creating HTML and CSS files.
  • The inclusion of a CSS file is presented as optional, suggesting that users can create a functional webpage with HTML alone, but styling is recommended for a more appealing design.
  • The guide's structure, with numbered steps and visual aids, indicates a user-friendly approach to teaching web development basics.
  • The use of descriptive captions and figures implies that visual examples are considered helpful for learning and following along with the instructions.
  • The guide's emphasis on the absence of backend functionality suggests that it is targeted at beginners or those looking to create simple, static web pages without server-side programming.

Create HTML webpage using Visual Studio Code without backend

  1. Install Vscode: Link Download
  2. Open Visual Studio Code: Launch Visual Studio Code on your computer.
  3. Create a New HTML File: Click on “File” -> “New File” to create a new file.
Create a New HTML File: Click on “File” -> “New File” to create a new file. (foto/@andihermanto)

4. Write HTML Code

#Examples:
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Re-Designs Web</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <header>
        <h1>Welcome to My Website</h1>
        <nav>
            <ul>
                <li><a href="#home">Home</a></li>
                <li><a href="#about">About</a></li>
                <li><a href="#contact">Contact</a></li>
            </ul>
        </nav>
    </header>
    <main>
        <section id="home">
            <h2>Home</h2>
            <p>Welcome to my simple website. This is the home section.</p>
        </section>
        <section id="about">
            <h2>About</h2>
            <p>This is the about section. Learn more about me here.</p>
        </section>
        <section id="contact">
            <h2>Contact</h2>
            <p>Contact me at [email protected]</p>
        </section>
    </main>
    <footer>
        <p>&copy; 2024 MyWebsite. All rights reserved.</p>
    </footer>
</body>
</html>

5. Save the HTML File: Save your file with a .html extension, for example, index.html.

index.html (foto/@andihermanto)

6. Create a CSS File (Optional): If you want to add styles to your webpage, create a new file and name it style.css. Write your CSS code in this file.

7. Link CSS File to HTML: If you’ve created a CSS file, link it to your HTML file by adding the following line in the section of your HTML file:

<link rel=”stylesheet” href=”style.css”>

create file name style.css

Examples code css:

/* Reset some default browser styles */
body, h1, h2, p, ul, li {
    margin: 0;
    padding: 0;
}

/* Global styles */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

header {
    background-color: #333;
    color: #fff;
    padding: 20px;
}

nav ul {
    list-style: none;
}

nav ul li {
    display: inline;
    margin-right: 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

main {
    padding: 20px;
}

section {
    margin-bottom: 20px;
}

footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
}

Now you have a basic HTML webpage without any backend functionality.

Preview Web without any backend
Vscode
Without Backend
HTML
Recommended from ReadMedium