CSS [attribute|="value"] Selector The[attribute|="value"]selector is used to select elements with the specified attribute, whose value can be exactly the specified value, or the specified value followed by a hyphen (-). Note:The value has to be a whole word, either alone, like class=...
CSS [attribute*="value"] Selector This selector selects elements that have a specific attribute with a value containing a specific substring. Syntax [attribute*="value"]{property:value;} Example This selector selects all the elements with a "src" attribute which contain an "css" in the pa...
CSS [attribute~="value"] Selector The[attribute~="value"]selector is used to select elements with an attribute value containing a specified word. The following example selects all elements with a title attribute that contains a space-separated list of words, one of which is "flower": ...
CSS [attribute|="value"] Selector The[attribute|="value"]selector is used to select elements with the specified attribute, whose value can be exactly the specified value, or the specified value followed by a hyphen (-). Note:The value has to be a whole word, either alone, like class=...
<!DOCTYPE html> <html> <head> <style> a[target="_blank"] { background-color: yellow; } </style> </head> <body> <h2>CSS [attribute="value"] Selector</h2> <p>The link with target="_blank" gets a yellow background:</p> <a href="https://www.w3schools.com">w3schools.com<...
在css3规范中,定义了以下几种类型的selector: Basic selector type selector: elementname class selector: .classname ID selector: #idName universal selector: * ns|* *|* attribute selector [attr=value] Combinators adjacent sibling selectors A+B ...
Syntax of [attribute] selectorHTML element[attribute]/[attribute]{ /* CSS properties*/ } Example: Applying [attribute] selectorIn the given example, we have created four paragraphs using the <p> element. In the first and last paragraph, we have specified the class attribute along with its ...
css For example, we have single selector and multi selector: <divclass="form-group"><labelfor="standard-select">Standard Select</label><divclass="form-field select"><selectid="standard-select"name="standard-select"><optionvalue="Option 1">Option 1</option><optionvalue="Option 2">Option...
Version: CSS2Browser SupportThe numbers in the table specifies the first browser version that fully supports the selector.Selector [attribute] 4.0 7.0 2.0 3.1 9.6Note: For [attribute] to work in IE8 and earlier, a <!DOCTYPE> must be declared....
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, PHP, Python, Bootstrap, Java and XML.