Inline styling
One way of defining CSS rules for your HTML elements is through the use of inline styles. This method is not recommended because it mixes style with presentation and is difficult to maintain. It is an option though in some cases where you only need to define a very limited set of CSS rules. To use inline styles, simply place the style attribute inside the relevant HTML tag:
<p style="color:sienna;margin-left:20px">This is a paragraph.</p>
Now let's put some emphasis on the cascading of cascading style sheets. As you now know, styles can be defined in external style sheets, internal style sheets, or inline. There is a fourth level that we didn't discuss which is the browser default. You don't have any control over that though. In CSS, an inline style has the highest priority, which means that it will override a style defined in an internal style sheet, an external style sheet, or the browser default. If an inline style is not defined then any style rules defined in an internal style sheet would take precedence over styles defined in an external style sheet. The caveat here is that if a link to an external style sheet is placed after the internal style sheet in HTML <head>, the external style sheet will override the internal sheet!
- 程序員修煉之道:程序設計入門30講
- 自己動手寫搜索引擎
- Visual Basic編程:從基礎到實踐(第2版)
- HoloLens Beginner's Guide
- Python網絡爬蟲從入門到實踐(第2版)
- Learning Informatica PowerCenter 10.x(Second Edition)
- Python神經網絡項目實戰
- Getting Started with SQL Server 2012 Cube Development
- Visual Basic程序設計與應用實踐教程
- QGIS By Example
- C語言程序設計實驗指導 (第2版)
- 軟件品質之完美管理:實戰經典
- Programming with CodeIgniterMVC
- Practical Game Design with Unity and Playmaker
- Scratch3.0趣味編程動手玩:比賽訓練營