Download ArticleDownload Article

This How.com.vn teaches you how to use Windows' Notepad app to store information for a webpage written in HTML and CSS. HTML is the programming language used to create your webpage, while CSS is the language that determines the style—color, font, and so on—of the HTML elements on the webpage.

Part 1
Part 1 of 3:

Creating an HTML Page

Download Article
  1. How.com.vn English: Step 1 Open Notepad.
    Open Start
    How.com.vn English: Windows Start
    , type in notepad, and click the blue Notepad app at the top of the Start window.
  2. How.com.vn English: Step 2 Indicate the document type.
    Type <!DOCTYPE html> into Notepad, then press Enter to start a new line.
    Advertisement
  3. How.com.vn English: Step 3 Add the HTML tag.
    Type in <html> and press Enter.
  4. How.com.vn English: Step 4 Enter the BODY tag.
    Type in <body> and press Enter. You can now begin entering your webpage's information.
  5. How.com.vn English: Step 5 Add a header.
    Type in <h1>TEXT</h1>, making sure to replace "TEXT" with your preferred page heading, and press Enter.
    • For example, to create a page header that says "Welcome!", you would type <h1>Welcome!</h1> into Notepad.
  6. How.com.vn English: Step 6 Add text below the header.
    Type in <p1>TEXT</p1>, making sure to replace "TEXT" with your preferred message, and press Enter.
    • For example, to add text that says "I am an iguana", you would enter <p1>I am an iguana</p1> into Notepad.
  7. How.com.vn English: Step 7 Add more headers and paragraphs.
    Each subsequent header and paragraph must have an ascending number applied to it; for example, your second header will have <h2></h2> tags around it, and the second paragraph will have <p2></p2> tags.
    • Make sure that you're continuing to press Enter after each line of code.
  8. How.com.vn English: Step 8 Close the BODY and HTML tags.
    Once you've entered your last line of code, type in </body> on its own line and press Enter, then type in </html>. Your document is now ready to be styled with CSS.
  9. Advertisement
Part 2
Part 2 of 3:

Adding CSS

Download Article
  1. How.com.vn English: Step 1 Understand how CSS works.
    You use CSS to change the appearance of an HTML element (e.g., a paragraph). CSS is typically written in the following line-by-line format:[1]
    • element tag { (for example, p {)
    • modifier: property; (for example, font-size: 20px;)
    • modifier: property; (for example, color: black;)
    • }
  2. How.com.vn English: Step 2 Place a space between the <html> and <body> tags.
    These should be near the top of the page.
  3. How.com.vn English: Step 3 Enter a HEAD tag.
    Type in <head> and press Enter.
  4. How.com.vn English: Step 4 Add a STYLE tag.
    Type in <style> and press Enter.
  5. How.com.vn English: Step 5 Change your webpage's background color.
    To do so:
    • Type in body { and press Enter.
    • Type in background-color: lightblue; and press Enter.
      • You can use any supported color here, as well as "light" or "dark" modifiers.
    • Type in } and press Enter.
  6. How.com.vn English: Step 6 Style your first header.
    Type in h1 { and press Enter, add a modifier and press Enter, and type in } and press Enter. You can add multiple modifiers to one element as long as each modifier is on its own line. Common modifiers include the following:
    • Text size - Type in font-size: 30px; to set your text as 30-point font. Substitute any number that you want to use.
    • Text color - Type in color: black; to make black text. Substitute any color that you want to use.
    • Text alignment - Type in text-align: center; to center the text. You can also type left or right to align the text appropriately.
    • Font used - Type in font-family: times new roman; to set your font as Times New Roman. You can also use fonts like verdana or georgia.
  7. How.com.vn English: Step 7 Style your first paragraph.
    Type in p1 { and press Enter, add a modifier and press Enter, and type in } and press Enter.
    • The modifiers that you can use here are identical to the ones used for the header.
  8. How.com.vn English: Step 8 Style the rest of your document.
    You can style any element by referencing its tag text and placing an open curly bracket ({), adding modifiers, and then closing the bracket (}).
  9. How.com.vn English: Step 9 Close the STYLE and HEAD tags.
    On a new line below your last styling text, type in </style> and press Enter, then type in </head> and press Enter. Your CSS sheet is complete, meaning that you can now review and save it.
  10. Advertisement
Part 3
Part 3 of 3:

Saving the Document

Download Article
  1. How.com.vn English: Step 1 Review your CSS stylesheet.
    Your CSS document will vary slightly, but it should look something like this:
    • <!DOCTYPE html>
    • <html>
    • <head>
    • <style>
    • body {
    • background-color: lightblue;
    • }
    • h1 {
    • font-size: 45px;
    • }
    • p1 {
    • color: black;
    • }
    • </style>
    • </head>
    • <body>
    • <h1>Hi!</h1>
    • <p1>I am an iguana</p1>
    • </body>
    • </html>
  2. How.com.vn English: Step 2 Click File.
    It's in the top-left corner of the Notepad window. A drop-down menu will appear.
  3. How.com.vn English: Step 3 Click Save As….
    You'll see this near the bottom of the drop-down menu. Clicking it prompts a window to open.
  4. How.com.vn English: Step 4 Select a save location.
    Click a folder (e.g., Desktop) on the left side of the window.
  5. Step 5 Click the "Save as type" drop-down box.
    A drop-down menu will appear.
  6. How.com.vn English: Step 6 Click All Files.
    It's in the drop-down menu.
  7. Step 7 Name your file with a ".html" extension.
    In the "File name" text field, type in your preferred document name (e.g., "My CSS") followed by .html.
    • For example, if you named your file "My CSS", you'd type my css.html into the field.
    • If you use a program that can run ".css" files, you can use .css instead of .html here.
  8. How.com.vn English: Step 8 Click Save.
    It's in the bottom-right side of the "Save As" window. This will save your CSS sheet in an executable format, meaning that you can open it in your preferred browser or HTML editor rather than in Notepad.
  9. Advertisement

Community Q&A

Search
Add New Question
  • Question
    What is the procedure to compile using a CSS file?
    How.com.vn English: Community Answer
    Community Answer
    CSS files do not need to be compiled. You may just link it to your .html header.
  • Question
    How do I create an account?
    How.com.vn English: Community Answer
    Community Answer
    Notepad files will be saved to your computer itself, so no account is necessary.
  • Question
    How do I run the CSS file?
    How.com.vn English: Community Answer
    Community Answer
    CSS files are stylesheets that extend HTML pages with styles. They are not able to be run, but must be specified as links in a tag.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      • When coding in HTML or CSS, it doesn't really matter how many spaces are between lines of code; you can press Enter several times after each line without changing the function of the program.
      • Try indenting different parts of your CSS stylesheet to make finding elements easier. For example, you might indent header code once and paragraph code twice.
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      Warnings

      • Always test your code before uploading it to a website or sharing it with other people.
      Advertisement

      About This Article

      How.com.vn English: Jack Lloyd
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Jack Lloyd. Jack Lloyd is a Technology Writer and Editor for How.com.vn. He has over two years of experience writing and editing technology-related articles. He is technology enthusiast and an English teacher. This article has been viewed 226,382 times.
      How helpful is this?
      Co-authors: 19
      Updated: February 2, 2024
      Views: 226,382
      Categories: Markup Languages
      Thanks to all authors for creating a page that has been read 226,382 times.

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement