Poechant's CSS Learning Note (诗商的CSS学习笔记)

To be continued (未完待续)...


1. Internal CSS style:

<style type="text/css">

...

</style>


2. External CSS style:

<link type="text/css" rel="stylesheet" href="mycss.css" />

Notice that <link> is an empty element.


3. Comment in CSS:

(null)


4. CSS selector

4.1. class selector:

If you have created a <p> element with "comment" class, then you chould use "." to specify this class as "p.comment". This selector could select all paragraphs in the "comment" class.

An element can be in more than one class, such as <p class="comment code article">.

4.2. id selector:

4.3. inherit selector:


5. Properties in HTML elements:

The values of these properties could be px, keyword(color, font-size), % and so forth.


background-color: This property could control the background color of an element.(背景颜色)

- kerword:Aqua,Black, Blue, Fuchsia, Gray, Green, Lime, Maroon, Navy, Olive, Orange, Purple, Red, Sliver, Teal, White, Yellow.

- %:rgb(80%, 40%, 0%)

- number:rgb(204, 102, 0)

- #number: e.g.#cc6600


background-image: You can use this property to put an image behind an element.(背景图片)


border: This property puts a border around an element. You can have a solid border, a ridged border, a dotted border.(边框)

- numberpx

- enum: dotted

- color


border-bottom:


color: Use color property to set the font color of text elements.(字体颜色)

- color


font-family: (字体)

- enum: Andale Mono,Arial,Geneva,Georgia,sans-serif,Times,Times New Roman,Trebuchet MS,Verdana


font-size:(字体大小)

- px

- %

- em, for example 1.2em, this says that the font size should be scaled by 1.2.

- keyword: xx-small, x-smal, small, medium, large, x-large, xx-large.


font-style: Use this property for italic or oblique text.

- keyword:italic,oblique


font-weight: This property controls the weight of the text.(字体粗细)

- enum: bold, normal


letter-spacing: This property controls the spacing between letters.(字间距)


line-height:This property sets the space between lines in a text element.(行间距)


list-style:This property lets you change how list items look in a list.(列表项样式)


margin: You can set how much space between the edge of the element and its content.


margin-left

- e.g. 20%


margin-right

- e.g. 20%


text-align: You can set this property as left, right or center.(对其方式)


text-decoration:

-underline


6. Some keypoints

6.1.What if multipleselectors select an element?

There are multiple selectors that match this element and define the samecolorproperty. That's what we call a "conflict". Which rule breaks the tie? Well, if one rule is morespecificthan the others, then it wins.


6.2. If you had an element that belonged only to thegreenteaclass there would be an obvious winner: thep.greenteaselector is the most specific, so the text would be green. But you have an element that belongs toall threeclasses:greentea, raspberry, andblueberry. So, p.greentea, p.raspberry, and p.blueberry all select the element, and are of equal specificity. What do you do now?

You choose the one that is listed last in the CSS file. If you can't resolve a conflict because two selectors are equally specific, you use the ordering of the rules in your style sheet file. That is, you use the rule listed last in the CSS file (nearest the bottom). And in this case, that would be thep.blueberryrule.


6.3. What will happen if there is an error in my CSS?

If you have errors in your CSS, usually what happens is all the rules below the error are ignored.


6.4. font-family 中可以指定多个字体,如果不存在第一个字体,就会使用第二个,依次类推下去。


7. CSS validator

http://jigsaw.w3.org/css-validator/

内容概要:本文档详细介绍了Python从下载安装到实际应用的全流程。首先,针对不同操作系统(Windows、macOS、Linux)提供了详细的Python下载与安装指南,并强调了安装时的关键步骤如路径选择和环境变量配置。其次,文档讲解了开发环境的搭建,推荐了VS Code、PyCharm等编辑器以及Anaconda作为环境管理工具。接着,通过代码实例讲解了Python的基础语法,包括数据类型操作等简单实用的例子。最后,通过三个经典案例——排序算法可视化、文件自动化处理、数据可视化(Matplotlib),展示了Python在实际项目中的应用。此外,还提供了一些常见问题的解决方案,帮助初学者避开常见的陷阱。 适合人群:对编程有一定兴趣但缺乏Python经验的新手开发者,尤其是那些希望快速上手并应用于实际项目的学员。 使用场景及目标:①为初次接触Python的学习者提供完整的入门指导;②帮助用户顺利完成Python的安装配置;③通过具体案例让学习者掌握Python的基本语法和常用库的应用;④解决新手在学习过程中可能遇到的问题,提高学习效率。 阅读建议:建议读者按照文档顺序逐步学习,先掌握Python的安装配置,再深入理解基础语法,最后通过实战案例巩固所学知识。对于遇到的问题,可以参考“避坑指南”部分提供的解决方案。同时,在学习过程中应多动手实践,尝试修改示例代码,加深理解和记忆。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值