How to Create a Simple CSS Stylesheet Using Notepad
How to Create a Simple CSS Stylesheet Using Notepad
This wikiHow 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.
Steps

Creating an HTML Page

Open Notepad. Open Start Windows Start, type in notepad, and click the blue Notepad app at the top of the Start window.

Indicate the document type. Type into Notepad, then press ↵ Enter to start a new line.

Add the HTML tag. Type in and press ↵ Enter.

Enter the BODY tag. Type in and press ↵ Enter. You can now begin entering your webpage's information.

Add a header. Type in

TEXT

, 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

Welcome!

into Notepad.

Add text below the header. Type in TEXT, 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 I am an iguana into Notepad.

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

tags around it, and the second paragraph will have tags. Make sure that you're continuing to press ↵ Enter after each line of code.

Close the BODY and HTML tags. Once you've entered your last line of code, type in on its own line and press ↵ Enter, then type in . Your document is now ready to be styled with CSS.

Adding CSS

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: element tag { (for example, p {) modifier: property; (for example, font-size: 20px;) modifier: property; (for example, color: black;) }

Place a space between the and tags. These should be near the top of the page.

Enter a HEAD tag. Type in and press ↵ Enter.

Add a STYLE tag. Type in and press ↵ Enter, then type in and press ↵ Enter. Your CSS sheet is complete, meaning that you can now review and save it.

Saving the Document

Review your CSS stylesheet. Your CSS document will vary slightly, but it should look something like this:

Hi!

I am an iguana

Click File. It's in the top-left corner of the Notepad window. A drop-down menu will appear.

Click Save As…. You'll see this near the bottom of the drop-down menu. Clicking it prompts a window to open.

Select a save location. Click a folder (e.g., Desktop) on the left side of the window.

Click the "Save as type" drop-down box. A drop-down menu will appear.

Click All Files. It's in the drop-down menu.

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.

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.

What's your reaction?

Comments

https://lamidix.com/assets/images/user-avatar-s.jpg

0 comment

Write the first comment for this!