Book Image

The HTML and CSS Workshop

By : Lewis Coulson, Brett Jephson, Rob Larsen, Matt Park, Marian Zburlea
Book Image

The HTML and CSS Workshop

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

Overview of this book

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.
Table of Contents (15 chapters)
2
2. Structure and Layout
3
3. Text and Typography
5
5. Themes, Colors, and Polish
6
6. Responsive Web Design and Media Queries
7
7. Media – Audio, Video, and Canvas
12
12. Web Components

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.