Note that there are some explanatory texts on larger screens.

plurals
  1. POtwitter profile pic as background for a <div> instead of <img>
    primarykey
    data
    text
    <p>I'm using a twitter rotating feed script that I've customized, however the original can be found here if needed: <a href="http://www.webdevdoor.com/jquery/animated-twitter-feed-fade-rotation/" rel="nofollow">http://www.webdevdoor.com/jquery/animated-twitter-feed-fade-rotation/</a></p> <p>For the user profile picture I have the following code that works great:</p> <pre><code>feedHTML += '&lt;div class="twitter-pic" style="display: inline-block;"&gt;&lt;a href="https://twitter.com/'+tweetusername+'" target="_blank"&gt;&lt;img src="'+profileimage+'"images/twitter-feed-icon.png" width="22" height="22" alt="twitter icon" style="vertical-align: middle;" /&gt;&lt;/a&gt;&amp;nbsp;&lt;img src="assets/images/twitter_feed_icon.png" alt="bigscoots twitter" style="vertical-align:middle;" /&gt;&amp;nbsp;&lt;/div&gt;'; </code></pre> <p>Now what I would like to do is display the image as a background image for a instead of the . I've tried a few variations however for some reason none of them seem to work, any thoughts?</p> <pre><code>feedHTML += '&lt;a href="https://twitter.com/'+tweetusername+'" target="_blank"&gt;&lt;div style="vertical-align: middle; display: inline-block; width: 22px; height: 22px; background-image:url('+profileimage+'images/twitter-feed-icon.png);"&gt;&lt;/div&gt;&lt;/a&gt;&lt;div style="display: inline-block;"&gt;&lt;img src="assets/images/twitter_feed_icon.png" alt="bigscoots twitter" style="vertical-align:middle;" /&gt;&amp;nbsp;&lt;/div&gt;'; </code></pre> <p>Thank you very much in advance!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload