Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the difference between the css partial value attribute selector and the dot class name notation

Shulou Source: shulou.com Published: 2022-06-01 10:47:44 10月04日 Update

This article mainly shows you the "css partial value attribute selector and dot class name notation what is the difference", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "css partial value attribute selector and dot class name notation is what the difference is" this article.

This selector is equivalent to the dot class name notation we discussed in the class selector.

That is, p.important and p [class= "important"] are equivalent when applied to HTML documents.

So why is there a "~ =" property selector? Because it can be used for any property, not just class.

For example, you can have a document that contains a large number of images, only some of which are pictures. To do this, you can use a partial property selector based on the title document to select only these images:

Img [title~= "Figure"] {border: 1px solid gray;}

This rule selects all images where the title text contains "Figure". Images that do not have a title attribute or do not contain "Figure" in the title attribute will not match.

The above is all the content of this article entitled "what is the difference between css partial value attribute selector and dot class name notation". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Select attribute class name part content image document article picture equivalence learning help that is that is only for this text easy to understand more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Information Apple macOS Shulou Tech Info