Skip to main content

Let's Create A Very Simple Web Page

Now we have learned the basic HTML elements and attributes. The first assignment from the course is to write a simple web page, which requires to include: Header, text, list, image, and hyperlink.

Before we write any code, we need to know how to combine all the elements into an entire HTML page. 


According to MDN Web Doc, it states that a HTML page must includes the following elements:

  1. <!DOCTYPE html>:  It is the shortest string of characters that counts as a valid doctype.
  2. <html></html>: This element wraps all the content on the entire page, and is sometimes known as the root element.
  3. <head></head>: This element acts as a container for all the stuff you want to include on the HTML page that isn't the content you are showing to your page's viewers. This includes things like keywords and a page description that you want to appear in search results.
  4. <meta charset="utf-8">: This element sets the character set your document should use to UTF-8, which includes most characters from the vast majority of human written languages. 
  5. <title></title>:  This sets the title of your page, which is the title that appears in the browser tab the page is loaded in, and is used to describe the page when you bookmark/favorite it.
  6. <body></body>: This contains all the content that you want to show to web users when they visit your page, whether that's text, images, videos, games, playable audio tracks, or whatever else. (This list is from Get Started to Learn HTML "Anatomy of a HTML Document")
I am going to create a very simple fashion style page, which includes a page title, a picture, a short list, and hyperlinks. My steps are:
  1. Open Sublime Text, create a new file and save as "Fashion Style webpage.html". We have to put ".html" in the document name, so you can run your code and check the web page on browser.
  2. Type "html" and click "Tab" on your keyboard, the html document will automatically show
  3. In the <title></title> element, write the page title "Fashion Style"
  4. Find the <body></body> element, and start write the page content.
  5. Start to build a simple paragraph use <p></p>, type some content inside the element.
  6. Insert an image by using the <img src=""> tag. Find an fashion image from Google, and copy the image link and paste in the tag.
  7. Type <h4></h4> or any other h tag to determine your subheading size.  Then write the a subheading text inside the tag.
  8. Use <ul></ul>(unordered list) to create a short fashion brand list
  9. Inside <ul> tag, write the brand name and add hyperlink attributes<a href=""></a> inside <li></li> (list item)
  10. In the hyperlink attribute, copy the web address of the brand homepage and paste in the attribute tag.
  11. Start a new line by using block-level tag <p></p> to make a call-to-action link. Inside the tag, write the call-to-action content "make sure to check on Dealmoon for good deals". Dealmoon is a publisher website, so I want to drive users to check that website out. So, I copy the Dealmoon homepage web address and paste it in the <a href=""> tag.
  12. Test the result


Once I finish the html part, I open the web page on Google Chrome, and it shows the exactly the way I want! 

I know this page looks very simple, but it is a good start!

Comments

Popular posts from this blog

GIT Study Note: Six Git Commands You Should Know!

What is Git? According to Git website , Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. Basically, we can use Git to track all of changes and revert them back if we made mistakes. The version control system is a way for us to work with different versions of our code, so that we can save different features and make notes as we progress. It is also very useful for team collaboration. Six Git Command You Should Know 1. Git Init In our server, we need to create a "Git" directory and inside of "Git", we make another direcory "git_inro". Then, we add a file "app,js" in the "git_intro" folder. The first thing we need to run is "git init" . When we run git init, it will make a directory which is hidden called ".git". Wherever I run that git init command, it's going to track all of our changes. ...

Intermediate Express.js: How To Render HTML From A EJS File?

The Express.js apps we have developed so far are just simply getting requests from users and sending matched message back to them. However, it is not what we want in the real web application. In most case, we want to send back a relevant web page when our app receives request from user. In order to do that, we need to npm install ejs file in the Express, create HTML page in the ejs file, and render HTMl from the ejs file. I know it sounds confuse now. I am going to explain more details in the example. EJS stands for embedded JavaScript. It lets us embed JavaScript code variables if statements loops inside of HTML. How to render HTML from a EJS file? Step One: Create a HTML page in EJS file Firstly, in our server, we create a folder named "EJSDemo". In this folder, we touch two files, one is "app.js", and the other one is "home.ejs". We are going to write a simple HTML code in the "home.ejs" file. The instructor create a dog page,...

Intro To Authentication: Three Useful Tools Will Make Everything Easier

Authentication is very important for both users and websites. It helps to keep users' information safe and also helps us to manage the accounts. Authentication is also complex because there is a lot of moving pieces that have to fit together in just the right way to make that work. The course introduce three tools to make authentication more quickly and safely. 1. Passport.js Passport.js will make our life easier and make our code shorter. It also helps to make implementation faster. Most importantly, it is used a lot in the real word. 2. Passport Local Passport Local is for username and password. It's about providing this entry point into all sorts of destinations. 3. Passport Local Mongoose This package will help us implement authentication with passport, and it's specially made to work with mongoose. We are also going to use these three tools into a Secret Page App project, which will show in next few posts.