i have a blog where i wanted to create a subsite listing my fav apps. for code consistency and for not confusing between existing html "normal" code describing website i made my own "subhtml" just for app cards.
for now best i did to this code was to display texted source of image instead of image. all css i tried already:
content: attr(data-src url)
, tried also attr both with url parameter and not, inside var()
and not, also background-image: attr(data-src url)
, all max-width
, max-height
, width
,height
with both 100%
and auto
properties , attr
value in root variable (this gives me text output of image i said above), tried also with ::before
thing but also gives nothing special...
current not yet working code:
:root{
--icon: attr(data-src);
}
app-icon::before{
display: inline-block;
content: var(--icon);
}
<app-box><app-title>app name</app-title><app-icon data-src="https://live.staticflickr.com/2552/3794648454_cf0c2a228b_b.jpg"></app-icon></app-box>
few additional notes:
- i don't want javascript (a11y)
- i don't want javascript (i dont like + confusing)
- yes i already was asking that in few places outside here but with no bigger help
- i know xml so i would like to use this also in few other projects too
- my browser is firefox but friends with other browsers also have this problem (so its not a browser bug, just my disknowledge of css)
- i know that custom tags doesnt have defined attributes except of id and class so i used custom one as was visible above =D
- i know default css property of img tag
inline-block
and im using it
screenshot of current bug :
this blog is under : https://hacknorris.neocities.org/app-store.html if someone would to test this bugg-css by themselves
so anyone knows how to display this image from custom tag?