CSS - Attribute Target



 CSS Attribute Target

Learn css - css tutorial - CSS Attribute Target - css examples - css programs

CSS Target attribute - Definition and Usage

  • In css :target selector is used to style the current active target element.
  • URLs with an # followed by an anchor name link to a definite element within a current document.
  • The element to be linked is the target element.
CSS Attribute Target
  • The [attribute="value"] selector is used to select elements with a named attribute and value.

css coding - Example

a[target="_blank"] 
{ 
font-size:40px;          
}
click below button to copy the code. By - css tutorial - team

html sample code - html code

 Tryit<!DOCTYPE html>
<html>
    <head>
        <style>
         a[target=_blank] 
         {
            font-size:40px;
         }
        </style>                     
    </head>
    <body>
        <a href="http://www.wikitechy.com" target="_blank">
         Click wikitechy
        </a>
    </body>
</html>
click below button to copy the code. By - css tutorial - team

Code Explanation - stylesheet css

Code Explanation Attribute Target
  1. a[target=-blank] is the target attribute that specifies where to open the linked document.
  2. Font-size property is used in CSS to increase the size of the font text. Here we have specified the font size as 40 pixels for attribute a[target] with value as _blank.
  3. In html, the <a> tag defines a hyperlink which directs the user from one page to another. target=”_blank” Opens the linked document in a new window.

css examples - Output

Output attribute target
  1. Click wikitechy is a link which appears color and underline. Clicking on the link directs us to the wikitechy website as displayed in the following browser window.
Output css attribute target

This page provides a detailed information on class in css , learn html and css , css programming , css website , css transition generator , css design , css language , css a , advanced css , html and css tutorial , css coding , html css tutorial , css javascript , html & css , free css , html and css editor , html css javascript , html css editor , css test , html css templates , css editor online.


View More Quick Examples

CSS BASICS & SELECTORS CSS SELECTOR ATTRIBUTE CSS STYLE FORMS COLORS & BACKGROUND CSS MARGIN & PADDING CSS WIDTH & HEIGHT CSS LINKS CSS BLOCKS

Related Searches to css attribute target