官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 广东省| 于田县| 晋中市| 剑阁县| 视频| 洪洞县| 赣州市| 奉新县| 尚志市| 宿松县| 新平| 清远市| 于都县| 峨边| 新和县| 临澧县| 安新县| 旬邑县| 夏津县| 都安| 珠海市| 保定市| 德阳市| 西乌珠穆沁旗| 台州市| 河南省| 江油市| 吴旗县| 天水市| 亳州市| 岑溪市| 洪湖市| 九龙坡区| 开原市| 三河市| 赣榆县| 祁阳县| 南江县| 丹棱县| 曲水县| 湘乡市|