- Mastering CSS
- Rich Finelli
- 222字
- 2021-07-08 09:46:00
Creating Buttons with Modular, Reusable CSS Classes, and CSS3
Having CSS that is modular and reusable makes it organized and concise, thereby avoiding situations where you may feel like pulling your hair out. Wouldn't it be awesome to just add the class of .button to an anchor element, no matter where that anchor element is in your markup, and have it transform into a button? CSS is "reusable" if you're able to use its classes anywhere and don't need these classes to be qualified by parent elements as long descendant selectors. The term "modular" refers to the ability to add variations to the button by adding another class to it so that one element can have two classes that could come together to form something very different.
A good example of how to write modular and reusable CSS is this: creating buttons. However, this concept should be applied everywhere, across all components of your website. We have a lot to go over in this chapter. We will cover modular CSS and multiple classes in the first two sections, before we switch gears and talk about how selectors can overrule each other in the specificity rules section. We'll then get into CSS3 pretty heavily with transitions, transforms, and gradients, and we'll go through every step of creating and styling a big call-to-action button.
- TypeScript Essentials
- Learning Cython Programming(Second Edition)
- 企業(yè)級Java EE架構(gòu)設(shè)計精深實踐
- 區(qū)塊鏈:以太坊DApp開發(fā)實戰(zhàn)
- Python高效開發(fā)實戰(zhàn):Django、Tornado、Flask、Twisted(第2版)
- MySQL數(shù)據(jù)庫管理與開發(fā)實踐教程 (清華電腦學(xué)堂)
- MySQL數(shù)據(jù)庫管理與開發(fā)(慕課版)
- Python Data Analysis(Second Edition)
- HTML5入門經(jīng)典
- Oracle 18c 必須掌握的新特性:管理與實戰(zhàn)
- Windows Phone 7.5:Building Location-aware Applications
- 一塊面包板玩轉(zhuǎn)Arduino編程
- TMS320LF240x芯片原理、設(shè)計及應(yīng)用
- C++從入門到精通(第6版)
- 精通Spring:Java Web開發(fā)與Spring Boot高級功能