The HTML and CSS Workshop
eBook - ePub

The HTML and CSS Workshop

A New, Interactive Approach to Learning HTML and CSS

Lewis Coulson, Brett Jephson, Rob Larsen, Matt Park, Marian Zburlea

Partager le livre
  1. 664 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

The HTML and CSS Workshop

A New, Interactive Approach to Learning HTML and CSS

Lewis Coulson, Brett Jephson, Rob Larsen, Matt Park, Marian Zburlea

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

Master HTML and CSS to create modern, stylish, and responsive websites with the help of real-world examples and hands-on activities

Key Features

  • Learn HTML and CSS to produce highly functional and appealing websites
  • Overcome common challenges in web design and development
  • Ensure that your websites are accessible and engaging on all devices

Book Description

With knowledge of CSS and HTML, you can build visually appealing, interactive websites without relying on website-building tools that come with lots of pre-packaged restrictions. The HTML and CSS Workshop takes you on a journey to learning how to create beautiful websites using your own content, understanding how they work, and how to manage them long-term.

The book begins by introducing you to HTML5 and CSS3, and takes you through the process of website development with easy-to-follow steps. Exploring how the browser renders websites from code to display, you'll advance to adding a cinematic experience to your website by incorporating video and audio elements into your code. You'll also use JavaScript to add interactivity to your site, integrate HTML forms for capturing user data, incorporate animations to create slick transitions, and build stunning themes using advanced CSS. You'll also get to grips with mobile-first development using responsive design and media queries, to ensure your sites perform well on any device.

Throughout the book, you'll work on engaging projects, including a video store home page that you will iteratively add functionality to as you learn new skills.

By the end of this Workshop, you'll have gained the confidence to creatively tackle your own ambitious web development projects.

What you will learn

  • Understand how websites are built, structured, and styled
  • Master the syntax and structure of HTML and CSS
  • Know how to build websites from scratch using HTML5 and CSS3
  • Create intuitive forms that allow users to input data
  • Style your website by integrating videos, animations, and themes
  • Design robust websites that work on all modern devices seamlessly
  • Discover how to maintain and improve the performance of a website

Who this book is for

Ideal for beginners, this Workshop is designed for anyone who is new to HTML and CSS who wants to learn to design and maintain their own websites.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que The HTML and CSS Workshop est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  The HTML and CSS Workshop par Lewis Coulson, Brett Jephson, Rob Larsen, Matt Park, Marian Zburlea en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Web Programming. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2019
ISBN
9781838828134
Édition
1
Sous-sujet
Web Programming

1. Introduction to HTML and CSS

Overview
By the end of this chapter, you will be able to describe the roles of HTML and CSS in a web page; explain the HTML DOM and CSSOM; explain how a web page renders; create a web page from scratch; and use CSS selectors and calculate CSS specificity. This chapter introduces two core technologies of the web – HTML and CSS. We will look at how they work, how we can write them, and how we can use them to build web pages.

Introduction

Whether you want to create a simple web page to advertise a business, blog about your hobbies and interests, maintain an online community, or even create your own social media network, HTML and CSS are the foundational technologies upon which you can build for the web and are a way for you to get your ideas out there to as wide an audience as possible.
When a web browser navigates to a web page, it will receive and parse an HTML document, which may include text, pictures, links, and other media (for instance, sound and video).
HTML structures this content. It gives it context, describes the content and tells the browser what to do with it. CSS tells the browser how to present the content. A set of styling rules lets the browser know how to render elements within the HTML document. HTML and CSS together give the browser the information it needs to render the web page for the user.
Navigate to a website and what you see is the rendered output of content marked up with HTML and styled with CSS. As a browser user, you have access to the source code of a web page. In Chrome, for example, you can view a page's source code with the keyboard shortcut Ctrl + U on a PC or Cmd + U on a Mac, or right-click and choose View Page Source. Try it yourself. As an example, the following two figures show what the Packt website's Web Development portal looks like when rendered in the browser and as source code respectively.
Ultimately, by learning how to write the HTML and CSS found in that source code, we can create a modern website:
Figure 1.1: The Packt Publishing site's Web Development portal
Figure 1.1: The Packt Publishing site's Web Development portal
The following figure shows the source code of the Packt website:
Figure 1.2: The HTML source code of the Packt site
Figure 1.2: The HTML source code of the Packt site
In this chapter, we will look at how a web page renders by following the process from initial request to completed composition. We will create our first web page and look at how a web browser will parse HTML and CSS to render that page. We will look at how browser developer tools, such as those included with the Chrome browser, can help us to identify and edit nodes within an HTML document and the CSS applied to those nodes.

HTML

HyperText Markup Language (HTML) is a markup language used to describe the structure of a web page.
Consider a snippet of text with no markup:
HTML HyperText Markup Language (HTML) is a markup language used to describe the structure of a web page. We can use it to differentiate such content as headings lists links images Want to https://www.packtpub.com/web-development Learn more about web development.
The above snippet of text may make some sense to you, but it may also raise some questions. Why does the snippet begin with the word HTML? Why is there a URL in the middle of a sentence? Is this one paragraph?
Using HTML, we can differentiate several bits of content to give them greater meaning. We could mark the word HTML as a heading, <h1>HTML</h1>; we could mark a link to another web page using the URL <a href="https://www.packtpub.com/web-development">Learn more about web development</a>.
Throughout this chapter, we will be looking at the HTML5 version of the HTML language. We will look at the syntax of HTML in the next section.

Syntax

The syntax of HTML is made up of tags (with angle brackets, <>) and attributes. HTML provides a set of tags that can be used to mark the beginning and end of a bit of content. The opening tag, closing tag, and all content within those bounds represent an HTML element. The following figure shows the HTML element representation without attributes:
Figure 1.3: HTML element representation without tag attributes
Figure 1.3: HTML element representation without tag attributes
The following figure shows the HTML element representation with tag attributes:
Figure 1.4: HTML element representation with tag attributes
Figure 1.4: HTML element representation with tag attributes
A tag has a name (for instance, p, img, h1, h2, h3, br, or hr) and that name combined with attributes will describe how the browser should handle the content. Many tags have a start and an end tag with some content in between, but there are also tags that don't expect any content, and these can be self-closing.
An opening tag can have any number of attributes associated with it. These are modifiers of the element. An attribute is a name-value pair. For example, href="https://www.packtpub.com/web-development" is an attribute with the name href and the value https://www.packtpub.com/web-development. An href attribute represents a hypertext reference or a URL, and when this attribute is added to an anchor element, <a>, it creates a hyperlink that the user can click in the browser to navigate to that URL.
To provide information within an HTML document to be ignored by the parser and not shown to the end user, you can add comments. These are useful for notes and documentation to aid anyone who might read or amend the source of the HTML document. A comment begins with <!-- and ends with -->. Comments, in HTML, can be single or multiline. The following are some examples:
<!-- Comment on a single line -->
<...

Table des matiĂšres