Search
 
SCRIPT & CODE EXAMPLE
 

CSS

css attribute selector

a[target="_blank"] {
  background-color: yellow;
}
/*w3schools*/
Comment

attribute selectors css

[class^='aus'] {
  /* Classes are attributes too!
    This will target any class that begins with 'aus':
    class='austria'
    class='australia'
  */
}

[src$='.jpg'] {
  /* This will target any src attribute that ends in '.jpg':
  src='puppy.jpg'
  src='kitten.jpg'
  */
}

[for*='ill'] {
  /* This will target any for attribute that has 'ill' anywhere inside it:
  for="bill"
  for="jill"
  for="silly"
  for="ill"
  */
}
Comment

attribute selectors in css

/*Advanced selectors*/
    h2 + p  /*every paragraph that is after "h2" */
    textarea ~ button /*every button that is aftrer textarea with same parent (<form> is the same parent in this example)*/
    ul > li /*every signle "li" inside of the "ul"*/
    ul li /*every "li" that goes up to "ul"*/

/*Attribute selectors*/
    p[class="review"] /*all of paragraphs with review class on them*/
    img[href^="../my code guide/"] /*every image that starts with that addres (replacing "=" with"^=")*/
    img[href$="../my code guide/"] /* its end with this attribute*/
    img[href*="../my code guide/"] /*if its contain anywhere*/
    h1[class~="site-header"] /*only works with white space seperator*/
    h1[class|="subtitle"] /*selects ones that starts with "subtitle" or "subtitle" and "-" in following*/
Comment

attribute selectors in css

/*Advanced selectors*/
    h2 + p  /*every paragraph that is after "h2" */
    textarea ~ button /*every button that is aftrer textarea with same parent (<form> is the same parent in this example)*/
    ul > li /*every signle "li" inside of the "ul"*/
    ul li /*every "li" that goes up to "ul"*/

/*Attribute selectors*/
    p[class="review"] /*all of paragraphs with review class on them*/
    img[href^="../my code guide/"] /*every image that starts with that addres (replacing "=" with"^=")*/
    img[href$="../my code guide/"] /* its end with this attribute*/
    img[href*="../my code guide/"] /*if its contain anywhere*/
    h1[class~="site-header"] /*only works with white space seperator*/
    h1[class|="subtitle"] /*selects ones that start with "subtitle" or "subtitle" and "-" in following*/
Comment

CSS Attribute Selectors

a[target] {
  background-color: yellow;
}
Comment

css attribute selector

/* <a> elements with a title attribute */
a[title] {
  color: purple;
}
/* <a> elements with an href matching "https://example.org" */
a[href="https://example.org"]
{
  color: green;
}
/* <a> elements with an href containing "example" */
a[href*="example"] {
  font-size: 2em;
}
/* <a> elements with an href ending ".org" */
a[href$=".org"] {
  font-style: italic;
}
/* <a> elements whose class attribute contains the word "logo" */
a[class~="logo"] {
  padding: 2px;
}
Comment

PREVIOUS NEXT
Code Example
Css :: css how to find all ids that end with something 
Css :: can a div change an item in another div css 
Css :: scss include 
Css :: Every user on your website has an image avatar that is displayed when 
Css :: highchart change font 
Css :: see css from site 
Css :: values play state animation css 
Css :: css preloader, preload website screen 
Css :: postion on window top css 
Css :: Text Shadow Hover Effect 
Css :: clip path css 
Css :: adding diffent style in firefox css 
Css :: css display original image in smalle width 
Css :: css clip-path 
Css :: css cursor pointer 
Css :: css float placeholder 
Css :: html css how to arrange images of different sizes 
Css :: css height 100 not working 
Css :: efectos imagenes css 
Css :: Set cellpadding and cellspacing in CSS? 
Css :: css color 
Css :: react use global css classes 
Css :: flex item: 1; 
Css :: how to remove list style in css 
Css :: css rich text editor tailwind 
Css :: opacity gradual css 
Css :: css black neomorphism 
Css :: box-shadow um ganzen div 
Css :: fullpage.js change the color of the anchor 
Css :: how to solve your coading bugs 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =