Book Image

Mastering CSS

By : Rich Finelli
Book Image

Mastering CSS

By: Rich Finelli

Overview of this book

Rich Finelli trains you in CSS deep learning and shows you the techniques you need to work in the world of responsive, feature-rich web applications. Based on his bestselling Mastering CSS training video, you can now learn with Rich in this book! Rich shares with you his skills in creating advanced layouts, and the critical CSS insights you need for responsive web designs, fonts, transitions, animations, and using flexbox. Rich begins your CSS training with a review of CSS best practices, such as using a good text editor to automate your authoring and setting up a CSS baseline. You then move on to create a responsive layout making use of floats and stylable drop-down menus, with Rich guiding you toward a modular-organized approach to CSS. Your training with Rich Finelli then dives into detail about working with CSS and the best solutions to make your websites work. You'll go with him into CSS3 properties, transforms, transitions, and animations. You’ll gain his understanding of responsive web designs, web fonts, icon fonts, and the techniques used to support retina devices. Rich expands your knowledge of CSS so you can master one of the most valuable tools in modern web design.
Table of Contents (12 chapters)

Shrinking images on the shark movies page

Let's take a look at the images on the movies page. They don't shrink when we resize the browser. They have fixed widths:

I think they should shrink; they're just a little too big in smaller browser sizes. The reason all three images on our movies page don't shrink is because their parent element does not have a width defined. Let's use Ethan Marcotte's formula-target divided by context equals result. We know the context of the area filled by the image, heading 1, paragraph, and learn more button is still 960px wide because it's inside of a wrapper:

So what is the width of the anchor tag that surrounds the image? If we look at our CSS, we have .content-block .figure, where there is no width defined:

.content-block .figure {
float: left;
margin: 30px 3.125%; /* 30/960 */
border: 15px solid #fff;
overflow...