Book Image

Practical Web Design

By : Philippe Hong
Book Image

Practical Web Design

By: Philippe Hong

Overview of this book

Web design is the process of creating websites. It encompasses several different aspects, including webpage layout, content production, and graphic design. This book offers you everything you need to know to build your websites. The book starts off by explaining the importance of web design and the basic design components used in website development. It'll show you insider tips to work quickly and efficiently with web technologies such as HTML5, CSS3, and JavaScript, concluding with a project on creating a static site with good layout. Once you've got that locked down, we'll get our hands dirty by diving straight into learning JavaScript and JQuery, ending with a project on creating dynamic content for your website. After getting our basic website up and running with the dynamic functionalities you'll move on to building your own responsive websites using more advanced techniques such as Bootstrap. Later you will learn smart ways to add dynamic content, and modern UI techniques such as Adaptive UI and Material Design. This will help you understand important concepts such as server-side rendering and UI components. Finally we take a look at various developer tools to ease your web development process.
Table of Contents (20 chapters)
Title Page
PacktPub.com
Contributers
Preface
Index

CSS pseudo-classes


A pseudo-class is used to define a special state of an element. For example, when you hover or when you click on a button, a state can be activated. 

We're going to learn two easy pseudo-classes for the moment, the most common ones. You can easily add and activate other pseudo-classes when you know how to use them:

Different pseudo-classes

The two pseudo-classes are hover and active. The hover state is used when you hover over an element with the mouse. It's useful to show that the element is clickable. The active state, on the other hand, is used when you click on an element. 

To use these pseudo-classes, you simply have to call them with a colon :

.element:hover {
    // Display something
}

.element:active {
    // Display something
}

For the first example, we'll add some styling when hovering over the links in the menu. We want to add an underline to the link when hovering it. To do that, it will be better for us to be able to target every single <a> with a class...