Archive for February, 2012

Resize & Crop Image using CSS

buat div dimana tempat image akan di tampilkan/display:

.img-div{
	width:155px; 
	height:146px; 
	float:left; 
	display:block; 
	overflow:hidden; 
	position:relative;
}

crop image agar sesuai dengan ukuran div yg telah dibuat diatas:

.img-crop{
    max-height: 146px;
    min-width: 155px;
    position: relative;
    top: 0;
}

applying ke html:

<div id="img-div">
	<img class="img-crop" src="images/fileimage.jpg">
</div>

Leave a comment

Make Div Into Link

It’s easy to make a div into a link using a bit of javascript. You can use this technique to make any div “clickable”. For example, you might want your “header” div to link to your home page. Here’s how:

<div onclick="location.href='page.html';"></div>

That’s it!

source: http://trevorturk.wordpress.com

Leave a comment

Design a site like this with WordPress.com
Get started