Add Image URL inside CSS file in SharePoint Visual Web Part

In this hint,I will explain How to Add Image URL placed in SharePoint “Images” Mapped Folder inside CSS file in SharePoint Visual Web Part.

"background-Image:URL(Image placed in Mapped Image folder)"

Steps:

  • Add SharePoint “Images” Mapped Folder

Add Image in visual WebPart

  • Add the preferred image in this folder by adding existing item.
  • Open your CSS file > Drag the image in an appropriate place, where it will be inserted as HTML IMG Tag.

URLImageCSS

  • Cut the image path without point .. then remove the <img> Tag to be the final url as
    • “/_layouts/images/ImageName.png”
  • Paste it within “background-image:url(/_layouts/images/ImageName.png)”;
  • The background-image property should be look like thisfinalurlcss

Enjoy 🙂

Advertisements

One thought on “Add Image URL inside CSS file in SharePoint Visual Web Part

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s