|
Posted by Lauri Raittila on 06/27/05 20:15
in alt.html, Greg N. wrote:
> Lauri Raittila wrote:
>
> > Of course, you could do it so that snipping happens from both ends, if
> > the most important part is in the middle, using CSS.
> how would you do that?
Using negative margins, for basically:
a {display:block;overflow:hidden;text-align:center;}
img {margin:0 -100px}
<a><img></a>
On wide screen it won't be starting from left, trough. For that, more
complex structure is needed:
div {overflow:hidden}
a {display:block;width:<img-size+100px>;align:center;}
img {margin-left:-100px}
<div><a><img></a></div>
For IE, you need to set width:100% here and there.
URL:
http://www.student.oulu.fi/~laurirai/www/css/clipimage/
--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Kohtuuhintainen yksiö/huone haussa Oulusta syyskuusta eteenpäin.
Searching places to sleep on axis Bonn - Tsech - Poland - baltic sea in
july
Navigation:
[Reply to this message]
|