CSS -- network programming

Familiar with memory 2021-01-21 12:57:00
css network programming


CSS summary

CSS Cascading style sheets (Cascading Style Sheets) Used to define the display effect of a web page . Can solve html Code repetition of style definition , Improve the maintainability of later style code , And enhanced the web page display effect function . In a word :CSS Separate web content from display style , Improved display function . that CSS and HTML How is it combined in web page code ? In four ways :style attribute 、style label 、 Import and link .

CSS And HTML Four ways to combine

* 1、style Attribute mode This method is rarely used , Because it's still with HTML almost . Usually use the back 3 Kind of .

<p style="background-color:#FF0000; color:#FFFFFF">
p Tag paragraph content .
</p>

* 2、style How to label

<style type=”text/css”>
p { color:#FF0000;}
</style>

* 3、 Import the way

<style type="text/css">
@import url(myDiv.css)
</style>

* 4、 Link way

<link rel="stylesheet" type="text/css" href="css_3.css" media="screen" /> 

Related to the grammar

* Style priority

From top to bottom , From the outside to the inside . Priority from low to high .—— All in all , The general situation is loading later , But there's also the priority of detail ( I'll talk about it later ).

*CSS Code format

Selector name { Property name : Property value ; Property name : Property value ;…….}

Between attributes, use A semicolon separate Attributes and attribute values are used directly The colon Connect If an attribute has multiple values , So many values with Space separate .

Selectors

Is to specify CSS Labels to work on , The name of that tag is the selector . Meaning for : Choose which container ( Tags themselves are containers that encapsulate data ).

* There are three kinds of selectors :

1) html Tag name selector . What you use is html The tag name of . ( That is to say, directly use html The label in ) 2) class Selectors . In fact, it's from the label class attribute . ( Add in front :# ) 3) id Selectors . In fact, the label is used id attribute . ( Add in front :. )

Every label defines class Properties and id attribute . Used to identify labels , It is convenient to operate the label . In the definition of , Multiple tags class Property values can be the same , and id The value should be unique , because JavaScript It is often used in .

* The priority of the selector Tag name selector < class Selectors < id Selectors < style attribute

Extension selector

* Association selector

Tags can be nested , To make different tags in the same tag display different styles , You can use this selector . for example :

p { color:#00FF00;}
p b { color:#FF000;}
<p>P label <b> Hunan City College </b> paragraph style </p>
<p>P Tag paragraph </p> 

Set up P label . Set up P In the tag b label .

* Combination selector

Define multiple selectors in the same style . for example , We want to be right “div Medium label ” and “ Class called cc” The same style as the locale of , You can define the following combination selector :

.cc, div b{/* The different selectors are separated by commas */
background-color:#0000ff;
color:#fff;
} 

Set up id=”cc” The label and div Label under b label .

* Pseudo element selector

In fact, it is html Some of the predefined selectors in , Called pseudo elements .

Format : Tag name : Pseudo elements . Class name Tag name . Class name : Pseudo elements .

Hyperlinks a Pseudo elements in tags :

a:link Hyperlink not clicked status . a:visited The state of being accessed . a:hover The cursor moves to the state on the hyperlink ( Did not click ). a:active The state of clicking on a hyperlink .

The paragraph p Pseudo elements in tags : p:first-line The first line of the paragraph . p:first-letter The first letter in the paragraph .

Custom pseudo elements :

:focus Elements with focus ( In fact, it's a bit like listening after clicking )

div:hover{
background-color:#f00;
color:#fff;
}

CSS Box model of

◇ Frame (border) On border-top Next border-bottom Left border-left Right border-right

◇ Paddings (Paddings): padding On padding-top Next padding-bottom Left padding-left Right padding-right

◇ External patch (Margins): Margin On margin-top Next margin-bottom Left margin-left Right margin-right

Frame (border)— The boundary of the closed graph of the content of this element Paddings (Paddings): padding — The distance between the boundary of this element and the text of its content External patch (Margins): Margin — The boundary of one element is far away from the boundary of another element ( Frame ) Distance of

*CSS Layout —— floating

◇ float : none | left | right none : The default value is . Objects don't float left : Text flows to the right of the object ( This object flows to the left ) right : Text flows to the left of the object ( This object flows to the right )

◇ clear : none | left | right | both none : The default value is . Allows floating objects on both sides left : No floating objects are allowed on the left right : No floating objects are allowed on the right both : No floating objects are allowed

( If floating objects are not allowed , And there's just one object floating around , You need to occupy one line of this object , Then the object moves , Make room for the floating object , So they don't overlap )

*CSS Layout —— location ◇ position : static | absolute | fixed | relative static : The default value is . No special positioning , The object follows HTML Positioning rules . absolute : Drag objects out of the document stream , Use left , right , top , bottom And so on, relative to the closest parent object with the most positioning setting, the absolute positioning is performed . If there is no such parent , According to body object . And it cascades through z-index Attribute definitions . fixed : Not supported . Object orientation follows absolute (absolute) The way . But there are rules to follow . relative : Objects cannot be cascaded , But will be based on left , right , top , bottom Etc. are offset in the normal document stream .

absolute — Absolute positioning . If an object uses absolute positioning , In fact, it's equivalent to the object floating on another level ( overlap ), And the original level of their own position is covered by other modules .

relative — Relative positioning . If an object uses relative positioning , It's also equivalent to the object floating on another level ( overlap ), But the original level of their own position will not be covered by other modules .

*CSS Layout —— Mixed arrangement of pictures and texts *CSS Layout —— Image signature ( this 2 In fact, the implementation of this method uses the box model , Absolute positioning or relative positioning )

CSS And a lot of knowledge , You can write more , have a look API I'm familiar with , So much basic grammar ~~

Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .

版权声明
本文为[Familiar with memory]所创,转载请带上原文链接,感谢
https://javamana.com/2021/01/20210121125355154j.html

  1. 【计算机网络 12(1),尚学堂马士兵Java视频教程
  2. 【程序猿历程,史上最全的Java面试题集锦在这里
  3. 【程序猿历程(1),Javaweb视频教程百度云
  4. Notes on MySQL 45 lectures (1-7)
  5. [computer network 12 (1), Shang Xuetang Ma soldier java video tutorial
  6. The most complete collection of Java interview questions in history is here
  7. [process of program ape (1), JavaWeb video tutorial, baidu cloud
  8. Notes on MySQL 45 lectures (1-7)
  9. 精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件
  10. Refined spring boot 03: spring boot configuration files and configuration management, and reading configuration files in three ways
  11. 精进 Spring Boot 03:Spring Boot 的配置文件和配置管理,以及用三种方式读取配置文件
  12. Refined spring boot 03: spring boot configuration files and configuration management, and reading configuration files in three ways
  13. 【递归,Java传智播客笔记
  14. [recursion, Java intelligence podcast notes
  15. [adhere to painting for 386 days] the beginning of spring of 24 solar terms
  16. K8S系列第八篇(Service、EndPoints以及高可用kubeadm部署)
  17. K8s Series Part 8 (service, endpoints and high availability kubeadm deployment)
  18. 【重识 HTML (3),350道Java面试真题分享
  19. 【重识 HTML (2),Java并发编程必会的多线程你竟然还不会
  20. 【重识 HTML (1),二本Java小菜鸟4面字节跳动被秒成渣渣
  21. [re recognize HTML (3) and share 350 real Java interview questions
  22. [re recognize HTML (2). Multithreading is a must for Java Concurrent Programming. How dare you not
  23. [re recognize HTML (1), two Java rookies' 4-sided bytes beat and become slag in seconds
  24. 造轮子系列之RPC 1:如何从零开始开发RPC框架
  25. RPC 1: how to develop RPC framework from scratch
  26. 造轮子系列之RPC 1:如何从零开始开发RPC框架
  27. RPC 1: how to develop RPC framework from scratch
  28. 一次性捋清楚吧,对乱糟糟的,Spring事务扩展机制
  29. 一文彻底弄懂如何选择抽象类还是接口,连续四年百度Java岗必问面试题
  30. Redis常用命令
  31. 一双拖鞋引发的血案,狂神说Java系列笔记
  32. 一、mysql基础安装
  33. 一位程序员的独白:尽管我一生坎坷,Java框架面试基础
  34. Clear it all at once. For the messy, spring transaction extension mechanism
  35. A thorough understanding of how to choose abstract classes or interfaces, baidu Java post must ask interview questions for four consecutive years
  36. Redis common commands
  37. A pair of slippers triggered the murder, crazy God said java series notes
  38. 1、 MySQL basic installation
  39. Monologue of a programmer: despite my ups and downs in my life, Java framework is the foundation of interview
  40. 【大厂面试】三面三问Spring循环依赖,请一定要把这篇看完(建议收藏)
  41. 一线互联网企业中,springboot入门项目
  42. 一篇文带你入门SSM框架Spring开发,帮你快速拿Offer
  43. 【面试资料】Java全集、微服务、大数据、数据结构与算法、机器学习知识最全总结,283页pdf
  44. 【leetcode刷题】24.数组中重复的数字——Java版
  45. 【leetcode刷题】23.对称二叉树——Java版
  46. 【leetcode刷题】22.二叉树的中序遍历——Java版
  47. 【leetcode刷题】21.三数之和——Java版
  48. 【leetcode刷题】20.最长回文子串——Java版
  49. 【leetcode刷题】19.回文链表——Java版
  50. 【leetcode刷题】18.反转链表——Java版
  51. 【leetcode刷题】17.相交链表——Java&python版
  52. 【leetcode刷题】16.环形链表——Java版
  53. 【leetcode刷题】15.汉明距离——Java版
  54. 【leetcode刷题】14.找到所有数组中消失的数字——Java版
  55. 【leetcode刷题】13.比特位计数——Java版
  56. oracle控制用户权限命令
  57. 三年Java开发,继阿里,鲁班二期Java架构师
  58. Oracle必须要启动的服务
  59. 万字长文!深入剖析HashMap,Java基础笔试题大全带答案
  60. 一问Kafka就心慌?我却凭着这份,图灵学院vip课程百度云