Reputation: 3956
I am attempting to clip a photograph, but I want the photo to be in the same position as if it would be had I not clipped it. The problem is with CSS you need a position:absolute attribute in the css which then covers up data.
For example:
<html>
<head>
<style>
img {
position: absolute;
clip: rect(0px,60px,200px,0px);
}
</style>
</head>
<body>
<img src="w3css.gif" width="100" height="140">
this is some text
</body>
</html>
This code covers up the "this is some text" text with the clipped image.
So I want a clipped image but the text not to be covered up.
Upvotes: 0
Views: 4018
Reputation: 23002
It was because you had not given the topoffset
value.
img {
position: absolute;
clip: rect(20px,60px,200px,0px);
}
clip: rect(top offset, visible width, visible height, left offset)
Upvotes: 3