- MooTools 1.2 Beginner's Guide
- Jacob Gube Garrick Cheung
- 238字
- 2021-04-01 13:33:38
MooTools and CSS selectors
MooTools selects an element (or a set of elements) in the DOM using CSS selectors syntax.
Just a quick refresher on CSS terminology; a CSS style rule consists of:
selector { property: property value; }
selector
—indicates what elements will be affected by the style ruleproperty
—refers to the CSS property (also referred to as attribute). For example,color
is a CSS property, so isfont-style
. You can have multiple property declarations in one style rule.property value
—the value you want assigned to the property. For example,bold
is a possible CSS property value of thefont-weight
CSS property.
For example, if you wanted to select a paragraph element with an ID of awesomeParagraph
to give it a red color (in hexadecimal, this is #ff0)
, in CSS syntax you'd write:
#awesomeParagraph { color: #ff0; }
Also, if I wanted to increase its specificity and make sure that only paragraph elements having an ID of awesomeParagraph
are selected:
p#awesomeParagraph { color: #ff0; }
You'll be happy to know that this same syntax ports over to MooTools. What's more is that you'll be able to take advantage of all of CSS3's more complex selection syntax because even though CSS3 isn't supported by all browsers yet, MooTools supports them already. So you don't have to learn another syntax for writing selectors; you can use your existing knowledge of CSS. Awesome, isn't it?
- CorelDRAW X6圖形設計立體化教程
- 持續演進的Cloud Native:云原生架構下微服務最佳實踐
- Spring Python 1.1
- Photoshop CC 實戰入門
- SPSS進階分析與實務
- Python數據分析實戰:從Excel輕松入門Pandas
- Drupal: Creating Blogs, Forums, Portals, and Community Websites
- After Effects CC 2018影視特效與合成案例教程
- 輕松玩轉3D One AI
- 中文版Photoshop CS6從新手到高手(超值版)
- Premiere Pro CC 2015中文版基礎與實例教程(第4版)
- KNIME視覺化數據分析
- 24小時學會Word-Excel-PowerPoint 2010三合一
- 中文版Photoshop CS6基礎教程
- 新手學Flash CS6動畫制作