Attribute Selector
By Stephen Bucaro
The attribute selector selects an html element by the value of an attribute.
For example, the style definition below selects only anchor elements that have
"http:" as part of their value string for the href attribute.
a[href^="http:"]
{
text-decoration: none;
border-bottom-style: dotted;
border-bottom-width: 1px;
}
<a href="http://bucarotechelp.com">Visit Bucaro TecHelp</a>
The style definition above causes the link to be underlined with a dotted line
rather than the standard solid line. Buy using only relative links within your
web site you might use this method to allow users to distinguish between internal
and external links. The attribute selector works only with with browsers that
support the CSS 3 standard.
More CSS Quick Reference: • Set the Letter Spacing • position:relative • Set the border-collapse • Use an Embedded Style Sheet • Set the box-sizing Property • nth-child Selector • Set the Border Style • Grouped Selectors • Style the First Letter • Set the Background Properties
|