Web Programming 1
Web Programming 1
a- Definition
Internet is a global network of interconnected networks that enables
communication and information sharing between billions of computers and
other digital devices.
The Internet is not a single network, but a collection of smaller networks that
communicate with each other. The Internet uses protocols like TCP/IP to enable
different devices to understand each other.
In the early days, the internet was called ARPANET. The ARPANET
(Advanced Research Projects Agency Network) project was initiated in the
1960s by the American Defense Advanced Research Projects Agency (ARPA).
The aim was to create an attack-resistant communications network, enabling
researchers from different institutions to share information. ARPANET later
became INTERNET.
The Internet is accessible from almost anywhere in the world, provided you
have an Internet connection.
Internet offers a multitude of services, such as the World Wide Web, e-mail, file
transfer, voice over IP and more.
c- Internet services
The Internet offers a multitude of different services that have revolutionized the
way we live and work.
The Internet is more than just a communications network; it's a platform that
hosts a multitude of services. These services have transformed the way we
communicate, work, entertain ourselves and access information. Here are a few
of the most important:
The World Wide Web (WWW): This is probably the best-known
service. It is a graphical interface providing access to documents
a- Web fundamentals
There are some basics things that we need to know about the web before digging
in the depths.
1- Client/server architecture
Like most Internet services, the Web is based on a client/server architecture: to
obtain a Web page, the client requests it from the server that holds it.
Both client and server are software programs, and can be installed on any
machine.
The client software is called a browser, such as Firefox or Chrome.
A web browser is an application used for accessing websites.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
Example Explained
Understanding URLs
A URL (Uniform Resource Locator) is the address of a resource on the internet. It's like a
physical address for a website or a specific page within a website.
1. Protocol: This specifies the method used to access the resource. The most common protocol
is HTTP (Hypertext Transfer Protocol).
2. Domain Name: This identifies the specific website or server where the resource is located.
3. Domain Name System (DNS): This system translates human-readable domain names into
machine-readable IP addresses.
4. Path: This specifies the location of the resource within the server's file system.
5. Query String: Optional parameters that can be added to the URL to customize the request.
6. Fragment Identifier: Optional identifier used to specify a specific part of a document.
Example:
https://www.example.com/products/laptops/macbook-
pro?color=silver#technical-specs
1. User enters URL: You type a URL into your browser's address bar.
2. DNS Lookup: The browser queries a DNS server to resolve the domain name into an IP
address.
Types of URLs
Absolute URLs: These specify the complete address of a resource, including the protocol,
domain name, and path.
Relative URLs: These specify the location of a resource relative to the current page. They are
often used to link to other pages within the same website.
User Experience: Well-structured URLs can improve user experience by making websites
easier to navigate and remember.
Search Engine Optimization (SEO): Search engines use URLs as a ranking factor, so using
descriptive keywords in URLs can help improve search engine visibility.
Website Organization: URLs can help organize website content and make it easier to
manage.
By understanding the components and functions of URLs, you can better navigate the web
and create user-friendly websites.
Tags are categorized into two main types: paired tags, defined by a start tag and
an end tag, and empty tags, which are self-closing.
Paired Tags
Paired tags, also known as container tags, come in a set of two: an opening tag
and a closing tag. The opening tag signifies the start of a specific element, and
the closing tag marks its end. The content of the element resides between these
two tags.
Empty Tags
Empty tags, also called self-closing tags or singular tags, stand alone. They don't
have a closing tag because they don't enclose any content. They typically
represent elements that add specific formatting or structure to the document.
Example:
A text editor is a software application that allows you to create and modify text
files. In HTML, it serves as a canvas where you write your code. This code, once
interpreted by a browser, becomes the web page that you see on the screen.
Syntax highlighting: Different elements of the HTML code (tags, attributes) are
displayed in distinct colors to make reading and identifying errors easier.
Autocompletion: The editor suggests tags and attributes automatically, speeding up
typing.
Search and replace function: Allows you to quickly find and replace text in your
code.
Project management: For organizing multiple HTML files and their associated
resources.
A web browser is a software application that interprets HTML code and displays the result
on the screen. It's thanks to the browser that you can view the webpage you created.
Google Chrome: The most used browser in the world, known for its speed and many
features.
Mozilla Firefox: An open-source browser, highly customizable and privacy-oriented.
Safari: The default browser on Apple devices (Mac, iPhone, iPad).
Microsoft Edge: The default browser on Windows, which has evolved a lot in recent
years.
In summary:
The text editor is your creation tool, where you write the HTML code.
The browser is your visualization tool, where you see the result of your code.
Each time you modify your HTML code, you will need to reload the page in your
browser to see the changes.
HTML heading elements are used to define headings in a document. They are defined by the
<h1> to <h6> tags. The <h1> tag defines the most important heading, and <h6> defines the
least important heading.
Syntax:
The <p> element in HTML is used to define a paragraph. It is one of the most basic building
blocks of web pages.
HTML Links
In HTML, links are created using the <a> tag. This tag allows you to create clickable links to
other web pages, documents, or specific sections within the same page.
Basic Syntax:
Types of Links:
HTML Lists
Unordered Lists
Unordered lists are used to display a list of items without any specific order. They are often
used for lists of related items, such as a list of ingredients or a list of steps in a process.
Ordered lists are used to display a list of items in a specific order. They are often used for lists
of steps or instructions.
Syntax:
Example: