Linker IT Software
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Clip an image in HTML with CSS (Read 2441 times)
Gerrit-Jan Linker
YaBB Administrator

Posts: 75
Clip an image in HTML with CSS
02.10.08 at 16:13:18
Clip an image in HTML with CSS
To clip an image in HTML you can use CSS. Sometimes you may want to only display a part of an image. Instead of cutting the image to size you can clip the image in HTML and hide the portion you do not want to see.
There is a clip property but that seems to be difficult to use with relative positioning. I have trialled it a little bit but found the following technique more useful. I am using background images in table as tables are frequently used for layouting this may be not a drawback.
{  background-repeat : no-repeat;
   background-position:-210px -250px;

<tr><td>55</td><td height=130 width=300 class="tdimg" style="background-image:url(mol008.gif)"></td></tr>
<tr><td>55</td><td height=130 width=300 class="tdimg" style="background-image:url(mol009.gif)"></td></tr>

Back to top
« Last Edit: 02.10.08 at 16:17:30 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1