CSS - Attribute Selector Value

CSS - Attribute Selector

  • The [attribute] selector is used to select elements with a specific attribute values.
  • It represents an element with an attribute name of attribute.

Example :

text-decoration: none;

Sample code:

<!DOCTYPE html>          

            text-decoration: none;
href="http://www.wikitechy.com" target="_target”>
        Click wikitechy

Code Explanation :

    a[target] selector directs the user from one web page to another web page.

    Text-decoration property removes the underlined line from the link text (Click wikitechy) by displaying them as a normal text. 

Note :In general, almost all the links appear in blue color with underlined.

    The anchor <a> tag defines a hyperlink which directs the user from one page to another. target=”_blank” opens the linked website in a new window. Here we defined to open http://www.wikitechy.com website.


    Click wikitechy is a link which appears without underline. Clicking on the link directs us to the wikitechy website as displayed in the following browser window.