Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 16, 2012 11:27 AM by vinay13mar
Contributor
2503 Points
2118 Posts
May 16, 2012 09:50 AM|LINK
Hi,
I am using a 1440X1080 image on my background. I wonder if I can display a specific portion of this image?
Best Regards.
Here is the CSS:
#bahisresim { width: 100%; height: 40%; overflow: hidden; text-align: center; background-image: url('Images/Stadio_Sukru_Saracoglu.jpg'); background-repeat: no-repeat; background-size: 100% 100%; }
All-Star
20155 Points
3328 Posts
May 16, 2012 09:55 AM|LINK
You can check the following link!
http://stackoverflow.com/questions/57725/how-can-i-display-just-a-portion-of-an-image-in-html-css
More over you can also try Image Sprites!
http://www.w3schools.com/css/css_image_sprites.asp
Hope it helps u...
30184 Points
4906 Posts
May 16, 2012 10:10 AM|LINK
Yes,
This is possible and its called css sprit. Check the following code-
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> #bahisresim { width: 200px; height: 100px; background: url('http://www.prelovac.com/vladimir/wp-content/uploads/2008/03/example.jpg') -25px -170px ; background-repeat: no-repeat; } </style> </head> <body> <div id="bahisresim"> </div> <img src="http://www.prelovac.com/vladimir/wp-content/uploads/2008/03/example.jpg" /> </body> </html>
43054 Points
7039 Posts
MVP
May 16, 2012 10:26 AM|LINK
Hello,
You can use background-position CSS property for that.
Please 'Mark as Answer' if this post helps you.
Star
7756 Points
1626 Posts
May 16, 2012 11:27 AM|LINK
add this for specifying the image position
background-position: 0px -30px;
cenk1536
Contributor
2503 Points
2118 Posts
BackGround Image Question?
May 16, 2012 09:50 AM|LINK
Hi,
I am using a 1440X1080 image on my background. I wonder if I can display a specific portion of this image?
Best Regards.
Here is the CSS:
#bahisresim { width: 100%; height: 40%; overflow: hidden; text-align: center; background-image: url('Images/Stadio_Sukru_Saracoglu.jpg'); background-repeat: no-repeat; background-size: 100% 100%; }roopeshreddy
All-Star
20155 Points
3328 Posts
Re: BackGround Image Question?
May 16, 2012 09:55 AM|LINK
Hi,
You can check the following link!
http://stackoverflow.com/questions/57725/how-can-i-display-just-a-portion-of-an-image-in-html-css
More over you can also try Image Sprites!
http://www.w3schools.com/css/css_image_sprites.asp
Hope it helps u...
Roopesh Reddy C
Roopesh's Space
asteranup
All-Star
30184 Points
4906 Posts
Re: BackGround Image Question?
May 16, 2012 10:10 AM|LINK
Yes,
This is possible and its called css sprit. Check the following code-
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> #bahisresim { width: 200px; height: 100px; background: url('http://www.prelovac.com/vladimir/wp-content/uploads/2008/03/example.jpg') -25px -170px ; background-repeat: no-repeat; } </style> </head> <body> <div id="bahisresim"> </div> <img src="http://www.prelovac.com/vladimir/wp-content/uploads/2008/03/example.jpg" /> </body> </html>http://www.w3schools.com/css/css_image_sprites.asp
Anup Das Gupta
Mark as Answer if you feel so. Visit My Blog
Ruchira
All-Star
43054 Points
7039 Posts
MVP
Re: BackGround Image Question?
May 16, 2012 10:26 AM|LINK
Hello,
You can use background-position CSS property for that.
My Tech blog | My YouTube ChannelPlease 'Mark as Answer' if this post helps you.vinay13mar
Star
7756 Points
1626 Posts
Re: BackGround Image Question?
May 16, 2012 11:27 AM|LINK
add this for specifying the image position
background-position: 0px -30px;
V.K.Singh