css selector regexp css选择器 正则表达式 css 参考手册

jQuery 选择元素  a.text-success, a.text-danger, a.text-primary, a.text-info

$("a[class^=text-]")

  

css selector regexp css选择器 正则表达式

 

Selectors

This section is non-normative, as it merely summarizes the following sections.

A Selector represents a structure. This structure can be used as a condition (e.g. in a CSS rule) that determines which elements a selector matches in the document tree, or as a flat description of the HTML or XML fragment corresponding to that structure.

Selectors may range from simple element names to rich contextual representations.

The following table summarizes the Selector syntax:

 

PatternRepresentsDescriptionLevel
*any elementUniversal selector2
Ean element of type EType selector1
E[foo]an E element with a "foo" attributeAttribute selectors2
E[foo="bar"]an E element whose "foo" attribute value is exactly equal to "bar"Attribute selectors2
E[foo~="bar"]an E element whose "foo" attribute value is a list of whitespace-separated values, one of which is exactly equal to "bar"Attribute selectors2
E[foo^="bar"]an E element whose "foo" attribute value begins exactly with the string "bar"Attribute selectors3
E[foo$="bar"]an E element whose "foo" attribute value ends exactly with the string "bar"Attribute selectors3
E[foo*="bar"]an E element whose "foo" attribute value contains the substring "bar"Attribute selectors3
E[foo|="en"]an E element whose "foo" attribute has a hyphen-separated list of values beginning (from the left) with "en"Attribute selectors2
E:rootan E element, root of the documentStructural pseudo-classes3
E:nth-child(n)an E element, the n-th child of its parentStructural pseudo-classes3
E:nth-last-child(n)an E element, the n-th child of its parent, counting from the last oneStructural pseudo-classes3
E:nth-of-type(n)an E element, the n-th sibling of its typeStructural pseudo-classes3
E:nth-last-of-type(n)an E element, the n-th sibling of its type, counting from the last oneStructural pseudo-classes3
E:first-childan E element, first child of its parentStructural pseudo-classes2
E:last-childan E element, last child of its parentStructural pseudo-classes3
E:first-of-typean E element, first sibling of its typeStructural pseudo-classes3
E:last-of-typean E element, last sibling of its typeStructural pseudo-classes3
E:only-childan E element, only child of its parentStructural pseudo-classes3
E:only-of-typean E element, only sibling of its typeStructural pseudo-classes3
E:emptyan E element that has no children (including text nodes)Structural pseudo-classes3
E:link
E:visited
an E element being the source anchor of a hyperlink of which the target is not yet visited (:link) or already visited (:visited)The link pseudo-classes1
E:active
E:hover
E:focus
an E element during certain user actionsThe user action pseudo-classes1 and 2
E:targetan E element being the target of the referring URIThe target pseudo-class3
E:lang(fr)an element of type E in language "fr" (the document language specifies how language is determined)The :lang() pseudo-class2
E:enabled
E:disabled
a user interface element E which is enabled or disabledThe UI element states pseudo-classes3
E:checkeda user interface element E which is checked (for instance a radio-button or checkbox)The UI element states pseudo-classes3
E::first-linethe first formatted line of an E elementThe ::first-line pseudo-element1
E::first-letterthe first formatted letter of an E elementThe ::first-letter pseudo-element1
E::beforegenerated content before an E elementThe ::before pseudo-element2
E::aftergenerated content after an E elementThe ::after pseudo-element2
E.warningan E element whose class is "warning" (the document language specifies how class is determined).Class selectors1
E#myidan E element with ID equal to "myid".ID selectors1
E:not(s)an E element that does not match simple selector sNegation pseudo-class3
E Fan F element descendant of an E elementDescendant combinator1
E > Fan F element child of an E elementChild combinator2
E + Fan F element immediately preceded by an E elementNext-sibling combinator2
E ~ Fan F element preceded by an E elementSubsequent-sibling combinator3

 

css 控制文字,超出部分显示...

.overflow-ellipsis {
  overflow: hidden;
  text-overflow: elllipsis;
  white-space: nowrap;
  display:inline-block;   
}

  

css 参考手册

https://github.com/doyoe/css-handbook

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

fareast_mzh

打赏个金币

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值