Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use css combination selector

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the css combination selector how to use the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe you will have something to gain after reading this css combination selector article, let's take a look at it.

Css basic selector

The basic selector is divided into: wildcard, tag selector, class selector, id selector. The programming ideas that need to be paid attention to here have one and only one id in the css cascading stylesheet. Note the following points: 1.id uniqueness 2. The element id is different, just like each person has only one ID card, ID represents that the ID card 3.class selector is not unique, it can be reused! In addition, this wildcard represents the overall situation.

one

two

three

four

five

6 css basic selector

seven

8 * {

9 color: skyblue

10} / * wildcard * /

11 div {

12 color: red

13} / * tag selector * /

14 .box {

15 color: steelblue

16} / * class selector * / .box {color: steelblue;} can also be written as * .box {color: steelblue;} all box fonts represented by steelblue 17 # content {

18 color: tomato

19} / * id selector * /

twenty

twenty-one

twenty-two

twenty-three

24 Learning Q-q-u-n: 784783012

twenty-six

twenty-seven

Css combination selector

The basic selector is called css combinatorial selector when it is strung together by special symbols. The common css combinatorial selectors are: grouping selector, nested selector, sub-selector, adjacent selector of the same level.

one

two

three

four

five

6 css combination selector

seven

8 / * div {9 color: teal; 10 font-size: 24px; 11} 12 p {13 color: teal; 14} * /

15 div {

16 font-size: 24px

17}

18 div,p {

19 color: teal

20} / * packet selector * /

21 div p {

22 color: red

23} / * nested selector * /

24 ul > li {

25 font-size: 24px

26 list-style: square

27} / * Sub-selector * /

28 div+p {

29 color: blue

30} / * adjacent peer selector * /

thirty-one

thirty-two

thirty-three

thirty-four

35 successful flowers, people only admire her present bright beauty! However, at the beginning, her bud was soaked in the tears of struggle and sprinkled with the blood rain of sacrifice.

thirty-six

I thought I knew a lot, experienced a lot, and finally realized that it was all so ridiculous.

thirty-seven

thirty-eight

We should not only look at the moment of honor of the winners, but also see the process of the winners' efforts and struggles, so as to motivate ourselves to keep giving and move forward towards that goal of success.

thirty-nine

The flower of success, people only admire her bright beauty now! However, at the beginning, her sprouts were soaked in tears of struggle and sprinkled with the blood rain of sacrifice. We should not only look at the moment of honor of the winners, but also see the process of the winners working and fighting for them, so as to inspire themselves to keep giving. Move forward towards that goal of success.

forty

41 1

42 2

43 3

forty-four

forty-five

forty-six

Css property Selector

Basic selector [attribute], basic selector [attribute = value], basic selector [attribute-= value] separate multiple spaces, basic selector [attribute ^ = value] starts with, basic selector [attribute $= value] ends with

one

two

three

four

five

6 css attribute Selector

seven

8 div [title] / * basic selector [attributes] * /

9 div [title=english] {

10 color: blue

11} / * basic selector [attribute = value] * /

12 div [title-- = en] {

13 color:#f90

14 font-weight: bold

15} / * basic selector [attribute-= value] any contains one of the attributes * /

16 pforce div [title ^ = zh] {

17 font-size:24px

18 color: brown

19} / * what does the basic selector [attribute ^ = value] start with * /

20 div [title$=china] {

21 letter-spacing: 10px

22 text-decoration: line-through

23 font-style: italic

24} / * basic selector [attribute $= value] where does it end * /

twenty-five

twenty-six

twenty-seven

twenty-eight

29 If you can NOT explain it simply, you do NOT understand it well enough 30

thirty-one

Haven't you noticed? 2013 love you for life, 2014 love you for life, 2015 love you a room, 2016 love you all the way, 2017 love you all the way, 2018 love you half, 2019 love you still, 2020 love you, 2021 love you only 33

thirty-four

35 css selector four categories: basic, combination, attribute, pseudo class 36

thirty-seven

38 http://www.cnblogs.com/dhnblog/p/12293463.html 39

forty

forty-one

Css pseudo-class selector

In the literal sense, fake is false, elements are the contents of tags and tags, simply speaking, pseudo elements are fake elements, false antonyms are true, and on the page we write these ourselves, so it is true. In this html page, all elements are secretly tagged with the beginning and end. This is the pseudo-element, and the pseudo-class selector refers to a state of operation!

one

two

three

four

five

6 css pseudo class selector

seven

8 p {

9 color: brown

10 border: 1px solid black

11 height: 40px

12 line-height: 40px

13}

14 p::before {

15 content: "start with before"

16}

17 p::after {

18 content: "after is over"

19}

20 / * for the first letter of block element 21:: first-letter 22 first line text:: first-line * /

23 div::first-letter {

24 font-size: 24px

25 color: blue

26}

27 div::first-line {

28 color: yellowgreen

29 font-style: initial

30 font-weight:bolder

31}

thirty-two

thirty-three

thirty-four

thirty-five

thirty-six

thirty-seven

Valentine's Day greeting to send my girlfriend, very sweet and sultry, instantly conquer her heart!

thirty-eight

thirty-nine

forty

forty-one

This is the end of the article on "how to use css combination selectors". Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to use the css combination selector". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report