1

I have one question..

I am using Asp.Net C# With SQL 2005

I have one grid in that and in grid i put one image box and i want to call image from my css.

when i use ImageUrl="~/Images/delete_link_thumb.gif" at image level then image is good but when i call from css through background-image:url(images/edit_link_thumb.gif); then image display is not good

Any suggestion??

Thanks

0

4 Answers 4

1

Path is the CSS is relative to where the CSS is stored in the web site.

Sign up to request clarification or add additional context in comments.

1 Comment

everything is good, even picture is coming also but it's not that perfect image which i got from Image-Url
0

as Fabian mentioned, try using background-image:url(/images/edit_link_thumb.gif);

2 Comments

i am using backgroud-image but i mention that image is not their proper shape. it's coming in 3d effect i don't know why ?? it's working fine in image-url
@kartik - Screen shot would help
0

firstly, ur referencing two different images in your question, besides that it depends on where your storing your stylesheet as it is relative to where it is in your project, try adding ../ in front of your images folder reference, like so:

url(../Images/blahblah.gif);

2 Comments

my friend image is coming ok but in image box X sign coming with red fore color and in background image is display
so are you giving an html image tag a css background image? seems like thats the case? in whish case your html image src is wrong
0

The case is ... If you use Image url directly it effects the image-box and its the default property of that box and as the css you are applying is not the default so it can also possible that it doesnt take the exactly size or it gives some additional padding or so in your css

so if you are using background property of css then you should supply the position argument also such as center center or whatever fits

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.