Skip to content

Instantly share code, notes, and snippets.

@jcsrb
Created April 19, 2012 13:07
Show Gist options
  • Save jcsrb/2420860 to your computer and use it in GitHub Desktop.
Save jcsrb/2420860 to your computer and use it in GitHub Desktop.
should this work?
a{
display:block;
}
/*
should this work?
concat of an attr with a string seams to work
if you look at the content rule in line 21
based on the css3 spec http://www.w3.org/TR/css3-values/#attr-value
if no type is given it's string
in ex 3 a.img sets the type to url which would be
equal to url(attr(href)) which neither work
*/
a.fav:after{
display:block;
background-image: url("http://g.etfv.co/"attr(href));
background-repeat: no-repeat;
text-indent: 16px;
content: "http://g.etfv.co/" attr(href);
}
a.img:after{
display:block;
background-image: attr(href url);
background-repeat: no-repeat;
text-indent: 16px;
content: "\0020";
}
<a class="fav" href="http://google.com">1 Google</a>
<a class="fav" href="http://reddit.com">2 Reddit</a>
<a class="img" href="http://i.imgur.com/nRIGx.jpg">3 Imagelink</a>
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment