Membuat Text Field Gradasi dengan CSS

  1. Buat terlebih dahulu background gradasi untuk text field di photoshop, misalnya:
    image background text field yang kita buat, kita beri nama bg_form.gif
  2. Buat css untuk kotak text field-nya terlebih dahulu, misalnya:
    input {
        height: 18px;
        width: 166px;
        border-top-width: 1px;
        border-right-width: 1px;
        border-bottom-width: 0px;
        border-left-width: 1px;
        border-top-style: solid;
        border-right-style: solid;
        border-bottom-style: none;
        border-left-style: solid;
        font-family: Arial;
        font-size: 10px;
        font-weight: normal;
        color: #C5C5C5;
        vertical-align: middle;
        padding-left: 5px;
        float: left;
        margin-top: 10px;
        margin-left: 10px;
        padding-top: 6px;
        border-right-color: #C5C5C5;
        border-left-color: #C5C5C5;
        border-top-color: #C5C5C5;
    }
  3. Buat css untuk background text field-nya dengan cara membuat class untuk text field tersebut, misalnya kita buat class dengan nama search:
    input.search {
        background-image: url(images/bg_form.gif);
    }
    masukkan image background yang kita sediakan untuk text field.

Contoh html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
* {
    margin: 0px;
    padding: 0px;
}
body {
    background-color: #A90504;
}
input {
    height: 18px;
    width: 166px;
    border-top-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 0px;
    border-left-width: 1px;
    border-top-style: solid;
    border-right-style: solid;
    border-bottom-style: none;
    border-left-style: solid;
    font-family: Arial;
    font-size: 10px;
    font-weight: normal;
    color: #C5C5C5;
    vertical-align: middle;
    padding-left: 5px;
    float: left;
    margin-top: 10px;
    margin-left: 10px;
    padding-top: 6px;
    border-right-color: #C5C5C5;
    border-left-color: #C5C5C5;
    border-top-color: #C5C5C5;
}
input.search {
    background-image: url(images/bg_form.gif);
}
-->
</style>
</head>

<body>
<input name="search" type="text" class="search" id="search" value="search" />
</body>
</html>

 

Untuk contohnya dapat dilihat di http://www.prowebpro.com/pic/erna/membuat_text_field_gradasi_dengan_css.php

Share |

Portfolio

www.wearnespc.comwww.solper.comwww.autojaya.comwww.intisolar.comsmartprint.co.idwww.ottopharm.comoliser.co.idAnd More ....

Livechat

  • LiveZilla Live Help

  • Aris G

  • Agus

  • Fazri

  • Rudi S

  • Bincar H

Address

PT. Proweb Indonesia
Perkantoran Duta Merlin No F4
Jl. Gadjah Mada 3-5
Jakarta Pusat

 

Phone : 021 - 2636 3170
     
Mobile : 0856 - 922 622 03
    0812 - 806 2772
    0816 - 180 8005
     
Fax : 021 - 633 5765
     
Web : www.proweb.co.id