Archive for March, 2012

centering image in div with CSS

Images are a little trickier. While most browsers will display images centered using the same text-align property, it’s not a good idea to rely on that technique, as it is not recommended by the W3C. Instead, you should explicitly tell the browser that the image is a block element. Then you can center it as you would a block. Here is the CSS:

img_center { display: block;   margin-left: auto;   margin-right: auto; }

And this is the HTML that applies to:

<img class="img_center" src="blwebcam-sample.jpg" alt="Suni"/>

source: http://webdesign.about.com

Leave a comment

id CSS Pseudo-classes

using div elemen:

#bahasa{height:56px; text-align:right; padding-right:3px; font-size:12px; color:#68b3e0}
   #bahasa a:link {color:#68b3e0; text-decoration:none}
   #bahasa a:visited {color:#68b3e0;}
   #bahasa a:hover {color:#ffffff; text-decoration:underline}
   #bahasa a:active {color:#68b3e0;}

using class elemen:

.bahasa{height:56px; text-align:right; padding-right:3px; font-size:12px; color:#68b3e0}
   .bahasa a:link {color:#68b3e0; text-decoration:none}
   .bahasa a:visited {color:#68b3e0;}
   .bahasa a:hover {color:#ffffff; text-decoration:underline}
   .bahasa a:active {color:#68b3e0;}

Leave a comment

limited show word in php

<?php
$kata="Lorem Ipsum adalah contoh teks atau dummy dalam industri percetakan dan penataan huruf atau typesetting. Lorem Ipsum telah menjadi standar contoh teks sejak tahun";
$exTulisan=explode(" ",$kata);
for($a=0; $a<8; $a++){
echo $exTulisan[$a]." ";
}
?>

Leave a comment

Design a site like this with WordPress.com
Get started