HTML Lesson 2

Background

Web development is all about communication. Like all types of communication, it requires the interaction between two (2) parties, that they should understand each other! (analogy: languages vs programming languages). In client-server communication, it is performed over the HTTP protocol (in the HTTP protocol the languages rules are defined).

Each side's (client-side and server-side) programming refers to the place where the code runs. The client-side code runs in the client machine, and server-side code runs in the server, wherever it is.

Client-server architecture

It is important to remark that the programming language DOES NOT determine if the code is server-side or client-side, the place where it is executed is what makes the difference.

Server-side Programming

The server side programming is the general name for the programs that run on the server.

The server

In computing, a server is a computer program or a device that provides functionality for other programs or devices, called "clients". This architecture is called the client–server model, and a single overall computation is distributed across multiple processes or devices. Servers can provide various functionalities, often called "services", such as sharing data or resources among multiple clients, or performing computation for a client.

Uses

Example Languages

Client-side (browser) Programming

Analogously to the server side programming, the client-side programming is the general name for the programs that run on the client.

Uses

Example Languages

Use of case

  1. The user opens the Mozilla Firefox (Web browser).
  2. The user browses to the Virtual campus of CEU.
  3. The client (by indication of the user) sends a request to the virtual campus of CEU, processing the meta-data, which is in the headers, and the page's source code (e.g. click right button right now and navigates to "view page source").
  4. The client renders the information to make it visible according to the browser specifications.
  5. The user types the username and the password, and submit the information.
  6. The client (browser) submits the data to the server
  7. The server processes the data received, make all the processing it needs, like checking if the username exists and if the password is correct.
  8. The server sends the response to the client. The response can be different depending on the processed data (if the username and password were correct or not).
  9. The client renders again the page received by the server response.

Hello, browser code

Browser run different types of code

Assignments

Now we are going to create our first HTML page, playing only with .css and .html documents. For now we will forget about .js programming to develop client-side functions.

Create a new plunker in your plnkr.co account. Remember to save a different plunker for each assignment, and save the documents created in the folder exercises within the unit2 directory. Name them as assignmentX.html, corresponding to each one of the next list

We are going to write some fake news in our prehistoric web! The source will be with you. You are encouraged to use the HTML tutorials and any search on internet.

  1. Writing fake news!
    • Copy the content of the file fakenews.html into the plunk editor. Wait until it loads the content. What do you see?
    • Change the title of the page. In which section do you do it?
    • Create the headline of the fake news. Use the HTML attributes to create the biggest head. Hint: use the <h1> tags!
    • Create the content. Use the HTML attributes to create them. Hint: use the <p> and <br> tags!
  2. Make a copy of your previous exercise! Now we are going to edit the text
    • Remark the main ideas of the text using a strong mark. Hint: use the <strong> tags!
    • Emphatise the first and the last sentence of the text. Hint: use the <em> tags!
  3. Make a copy of your previous exercise! Now we are going to do lists
    • Create a list with three headlines from other 3 fake news . Hint: use the <ul>, <ol> and <li> tags! What does each one? What is the difference between them?
    • Add some image to support your text. Hint:Use the <img> tag! Check the attributes of the <img> tag
    • Why the image does not show up in plnkr.co?
    • Use an attribute in the previous <img> tag to show an alternative text when the image cannot be displayed.
  4. Make a copy of your previous exercise! Let's stylize our arcaic web page. People do not believe fake news in b/w, we should make it real :)
    • Watch the css tutorial CSS w3schools
    • Add a <style> section in the header
    • Add a directive to change the background color of the <body> section
    • Add a directive to change the background color of the <p> sections
    • Add a directive to change the text color of the title (<h1> section)
    • EXTRA POINT! Will you be able to set different styles for different <p> tags? Ask the professor if you are interested and you need a hand!
    • DOUBLE EXTRA POINT! and will you be able to set the styles using classes? We can difference between paragraphs that are real and fake using the classes "real" and "fake". Ask the professor if you are interested and you need a hand!