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

Classes and IDs


We saw how to select HTML tags with CSS, but, most of the time, you'll have multiple identical HTML tags, such as <p> or <a>. How do we differentiate them so we can only select and style a specific one? Here come the classes and IDs. They're used to select a specific HTML tag you have put an attributeid or class, for example:

<div id="header"></div>
<p class="big"></p>

To select this ID header in CSS, we'll need to write a hash (#) character, followed by the ID of the element, in this case, header:

#header {
  margin-left: 10px;
}

To select a class, we'll need to write a period (.) character, followed by the name of the class:

.big {
  font-size:20px;
}

So what is the difference between IDs and classes? The only difference is that IDs can be used only once in an HTML document, while Classes can be used multiple times. We also need to know the following:

For IDs:

  • Each element can have only one ID
  • Each page can have only one element with that ID

 For...