Why is not the :after image shown

Leo

I am trying to add an "external link image" to a-links with a target attribute. I have taken the image Wikipedia uses (http://bits.wikimedia.org/static-1.24wmf5/skins/vector/images/external-link-ltr-icon.svg) and converted it to base64 with http://webcodertools.com/imagetobase64converter. I want to add it as a background image to a[target]:after.

<a target="_blank" href="http://bits.wikimedia.org/static-1.24wmf5/skins/vector/images/external-link-ltr-icon.svg">External link</a>

a[target]:after {
    background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwIiBoZWlnaHQ9IjEwIj48ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtODI2LjQyOSAtNjk4Ljc5MSkiPjxyZWN0IHdpZHRoPSI1Ljk4MiIgaGVpZ2h0PSI1Ljk4MiIgeD0iODI2LjkyOSIgeT0iNzAyLjMwOSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMDZjIi8+PGc+PHBhdGggZD0iTTgzMS4xOTQgNjk4Ljc5MWg1LjIzNHY1LjM5MWwtMS41NzEgMS41NDUtMS4zMS0xLjMxLTIuNzI1IDIuNzI1LTIuNjg5LTIuNjg5IDIuODA4LTIuODA4LTEuMzExLTEuMzExeiIgZmlsbD0iIzA2ZiIvPjxwYXRoIGQ9Ik04MzUuNDI0IDY5OS43OTVsLjAyMiA0Ljg4NS0xLjgxNy0xLjgxNy0yLjg4MSAyLjg4MS0xLjIyOC0xLjIyOCAyLjg4MS0yLjg4MS0xLjg1MS0xLjg1MXoiIGZpbGw9IiNmZmYiLz48L2c+PC9nPjwvc3ZnPg==);
}

The image seems somehow to be there. Chrome inspector seems to know about it, but nothing is shown however. Why is the image not shown? Or rather, what is the minimum CSS I need to add to make the image display?

Here is a fiddle: http://jsfiddle.net/lborgman/8CTWa/

Synthesis

The pseudo element has no dimensions: http://jsfiddle.net/8CTWa/3/

a[target]:after {
    background-image: url(...);
    content: "";
    display: inline-block; /* so we can give dimensions */
    height: 50px;
    width: 50px;
}

You can also insert the image within content: http://jsfiddle.net/8CTWa/4/

a[target]:after {
    content: url("...");
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Image not shown after setImageBitmap

From Dev

Why is the text not shown below the image?

From Dev

Loading Overlay shown after image processing

From Dev

Why image shown in UITabBar, on selected item, not properly?

From Dev

Why Image is not Shown in cellforRowAtIndexPath in objective C

From Dev

Why is the pseudo content :after not shown after but in the corresponding div?

From Dev

Why is MessageDlg not shown after a form is freed via OnClose event (in a thread)

From Dev

why "extra characters after command" error shown for the sed command line shown?

From Dev

Image is being shown as HTML but no image is shown for DOMPDF()

From Dev

Custom Image viewer. Simple image-gallery not shown after duplicating it, strange behavoir

From Dev

Custom Image viewer. Simple image-gallery not shown after duplicating it, strange behavoir

From Dev

Markdown image not shown

From Dev

WatchKit: image not shown

From Dev

Image not shown in Push Notification

From Dev

Styling Div as shown in image

From Dev

Colorbox Loaded - But Image is Not Shown

From Java

Why are usernames and images not shown?

From Dev

Why both the forms are shown

From Dev

Why are "<" , ">" , " and ' shown in this XML example?

From Dev

Why the Ajax content of this jQuery plugin (Tooltipster) is shown only after mouse hover 2 times?

From Dev

Why is a process being shown while using "jobs" command after killing the process manually?

From Dev

Duplicate image shown - useEffect issue?

From Dev

Image not shown for result suggestions in SearchBox

From Dev

Saving image shown in web browser

From Dev

arranging divs in the order shown in image

From Dev

NSTextAttachment image not shown in NSTextView (but in UITextView)?

From Dev

How to get the region shown in the image ?

From Dev

Default image not shown in ASP ImageField

From Dev

Titanium android remote image not shown

Related Related

  1. 1

    Image not shown after setImageBitmap

  2. 2

    Why is the text not shown below the image?

  3. 3

    Loading Overlay shown after image processing

  4. 4

    Why image shown in UITabBar, on selected item, not properly?

  5. 5

    Why Image is not Shown in cellforRowAtIndexPath in objective C

  6. 6

    Why is the pseudo content :after not shown after but in the corresponding div?

  7. 7

    Why is MessageDlg not shown after a form is freed via OnClose event (in a thread)

  8. 8

    why "extra characters after command" error shown for the sed command line shown?

  9. 9

    Image is being shown as HTML but no image is shown for DOMPDF()

  10. 10

    Custom Image viewer. Simple image-gallery not shown after duplicating it, strange behavoir

  11. 11

    Custom Image viewer. Simple image-gallery not shown after duplicating it, strange behavoir

  12. 12

    Markdown image not shown

  13. 13

    WatchKit: image not shown

  14. 14

    Image not shown in Push Notification

  15. 15

    Styling Div as shown in image

  16. 16

    Colorbox Loaded - But Image is Not Shown

  17. 17

    Why are usernames and images not shown?

  18. 18

    Why both the forms are shown

  19. 19

    Why are "<" , ">" , " and ' shown in this XML example?

  20. 20

    Why the Ajax content of this jQuery plugin (Tooltipster) is shown only after mouse hover 2 times?

  21. 21

    Why is a process being shown while using "jobs" command after killing the process manually?

  22. 22

    Duplicate image shown - useEffect issue?

  23. 23

    Image not shown for result suggestions in SearchBox

  24. 24

    Saving image shown in web browser

  25. 25

    arranging divs in the order shown in image

  26. 26

    NSTextAttachment image not shown in NSTextView (but in UITextView)?

  27. 27

    How to get the region shown in the image ?

  28. 28

    Default image not shown in ASP ImageField

  29. 29

    Titanium android remote image not shown

HotTag

Archive