/    Sign up×
Community /Pin to ProfileBookmark

show only a part of an image

hi
i wonder how to show only a part of an image, without editing the image, for example:
i have a smiley image (?)and i want to show only a half of the smiley.
thx!

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@CentauriDec 11.2007 — Set the image as a background to some element ( a div if no other element is available) and set its size to be smaller than the graphic.
Copy linkTweet thisAlerts:
@WebJoelDec 12.2007 — If the image is background-image in a container, you could position the image "background-position:X% Y%;" (here whereby "X" = left and "Y" = top, so, "50% 0" would be the values to state) and maybe set "overflow:hidden;" to the container if the image protrudes. It shouldn't though, being 'background'...

Or are you asking about the "clip" property? (example: [B]#thisDiv[/B] [B]{clip: rect(0, 0, 0, 50%);}[/B] )? Haven't used this in years, but it 'clips' an image without having to edit said image.
×

Success!

Help @arnoni spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...