Skip to main content

Explaining HTML

HTML is simply a language that allow you to categorize the information in a web page. It provide the information with meaning and structure. <head> </head> has the meaning of header information.
<p><a href="www.google.com"> Link! </a></p>, this provides structure that the link is inside the <p> tag and hence it is a paragraph..

<html>
<head>
    <title>Hello World</title>
</head>

<body>
     <h1> Kiss you Goodbye</h1>
</body>
</html>

The code above wrap the text/data/information "Hello World" into the <head> tag and <title> tag so the computer know what this information is about.

<tag> is the start of the tag, </tag> is the end of the tag. We need those special syntax because there is a need for the computer to know when certain item start and when it stops.

*If you want to assign attribute to a tag, use this syntax <a href="www.google.com">Link</a>
- This tell the computer that the link will bring you to Google website.

Syntax of a html tag
<a href="www.google.com"> link </a>


Purpose of Tag
- We need the html tag because we can specifically target them in CSS and javascript
<p> I am here </p>

p {
    color: red;
}

This will cause all paragraph elements to be red colored.

- We need the tag because we can assign class to it. Like so <p class="para"> I am here </p>


Comments

Popular posts from this blog

Problem Solving - Refactored

I am going to outline how I approach problem solving. The relative importance and the amount of effort/time required for each is stated as a percentage beside each topic. I borrowed some idea from George Polya's How to Solve It Thoroughly Understand the Problem (30%) When encountering hard problem , you need to deeply understand the problem at hand. Take a paper and list down all known facts and data and what the question is trying to find. Sketch out the problem if applicable. Visualize the problem in your head. A lot of times, we only have to understand the problem well, then the solution will obvious. Have a Plan (20%) You need to have an outline of how you are going to tackle the problem. You need to have a logical pathway that will ultimate produce outcome (nothing to do with coding syntax yet). Without a plan, you are just randomly poking around and got lucky. No hard problem ever gets solved without a plan. Plan using pseudo-code, pen & paper or flowchart. Use wh...

My Burnout Experience

I want to share with you my experience of burning out. After registering with Launch School, I am extremely excited about my programming journey. I studied for 10 to 12 hours a day, memorizing fact, trying out practice problems, understanding programming concepts. It was fun and exciting and I love seeing myself growing from nothing in programming to something more. After about 3 months, thing starts to change. I started noticing myself paying less attention to details. I find myself skimming through the course material. I skip "Further Exploration" in the practice problem. I am more interested to study just to pass the assessment rather than truly mastering the concept. It was a gradual burning out process but I continue to study for 10 to 12 hours a day through sheer grit. It felt like doing house chore or working a day job that you don't like. One particular morning I woke up, and I remember this deep feeling of dread because I can anticipate that the next 10 to 1...

Explain code

get "/" do pattern = File . join ( data_path , "*" ) @files = Dir . glob ( pattern ) . map do | path | File . basename ( path ) end erb :index end def data_path if ENV [ "RACK_ENV" ] == "test" File . expand_path ( "../test/data" , __FILE__ ) else File . expand_path ( "../data" , __FILE__ ) end end data_path will check if ENV hash with key "RACK_ENV" has the value of "test". If yes, then return the path from root to cms2/test/data folder. If not , then return the absolute path from root to the folder cms2/data Then, in get "/" block , join the data_path with * . If in development environment, then data_path is home/cms2/data then the return value is home/cms2/data/* We use File.join is good because it will detect the OS, then join with appropriate character.  With the pattern in place, we use Dir.glob to find the files. Here it return home/...