Tampilkan postingan dengan label Web Programming. Tampilkan semua postingan
Tampilkan postingan dengan label Web Programming. Tampilkan semua postingan

Default Css Properties

Your Ad Here

Without CSS, a page is bare but still, something of modesty it is because browsers down a set of default properties that will be applied unless the change. Have some differences depending on whether a browser or the other but, in general, are precisely those properties non-identified, that cause us problems because we do not usually taken into account.

The body of a page is where they are defined by default some of these properties is more or less known than the bottom (background) of a page is white and the color of the text (color) is black but has some more than likely to interfere For example, the margin (margin):

body {
background: # FFF url () repeat top left;
color: # 000;
font-family: Times New Roman;
font-size: 16px;
margin: 8px;
}

The links also have default properties, are blue and is underlined. All title tags are in bold fonts (font-weight: bold) and also a size that is related to the size of the font defined in the body. To make matters worse, it also has limits:
h1 font-size: 2em; margin: 21px 0;
h2 font-size: 1.5em; margin: 19px 0;
h3 font-size: 1.2em; margin: 19px 0;
h4 font-size: 1em; margin: 21px 0;
h5 font-size: .8 em; margin: 21px 0;
h6 font-size: .7 em; margin: 26px 0;

Or DIV or SPAN tags have default properties but if P is labeled, this has a top and bottom margin equal to the size of the default font (margin: 1em 0).

More labels with pre-defined properties:
blockquote margin: 16px 40px;
pre font-family: monospace; margin: 16px 0;

Images that act as links have a border of color like the color of links (border: 2px solid # 0000EE) .

Probably labels cause more conflicts are lists as both OL and UL have several properties, including margins and separations:
ol margin: 16px 0; padding-left: 40px; list-style-position: outside; list-style-type: decimal;
ul margin: 16px 0; padding-left: 40px; list-style-position: outside; list-style-type: disc;

Usually we read that to avoid all these properties do not bother us, it is best to "reset", ie to the beginning of our staff, some definitions to "clean" stuff. There are dozens of examples that can be found but for normal use, do not need much, just add a few right at the beginning of our staff within <style> </ style> or <b:skin> < / b: skin>..
* {Margin: 0; padding: 0;}

html, body {height: 100%;}
body {height: 100%;}

a, a: visited, a: link, a: active {outline: none; text-decoration: none;}
a: hover {outline: none; text-decoration: none;}
a img {border: none; outline: none; text-decoration: none;}

object, embed {outline: none;}

ol, ul, li {list-style: none;}

Of course, this must be case by case and that it is possible that some of the default properties are useful and we therefore take them out but we are not interested, it's always good to know that there are and where we started a new site, it is best to remove them all and take the trouble to define them one by one.

Read More - Default Css Properties

CSS simplify complicate optimize

Your Ad Here

Who does not want to optimize optimize things? It is obvious that something is always better to work best to work on a mediocre but on the web, we often read too much advice and beyond the good intentions of those who propose them, not all are applicable and even, some are arguable. Fortunately, as elsewhere, there is always more than one opinion and more of a solution and when it comes to tools, there is no perfect or used it for all so using common sense is always the best option although it is known that that is the least common of the senses. 

There are many sites that talk about compressing the CSS and there are even sites like CleanCSS offering automatic but these things do have to be used carefully, very carefully. 

An article by Impressive Webs titled something like "Give him some space to CSS to breathe" and an analysis of these things, reviewing alternatives and showing what is good and what is bad. It is obvious that these conclusions are subjective (like all) but we can read, think and then decide. 

There is something I think is basic, from the point of view of loading time, with few exceptions, compress the CSS does not matter and those just starting out can transform the code into an unmanageable mess that scares and preventing progress, the result will not be nothing but a bunch of characters difficult to digest and difficult to edit:

body{background-color:#343F4A;color:#CCC;font-family:'Trebuchet MS', Trebuchet, Helvetica, Arial, Verdana, Sans-Serif;font-size:12px;margin:0;min-width:920px ; padding: 0; text-align: center}. clear {clear: both; line-height: 0; height: 0} # navbar-iframe {height: 0; visibility: hidden; display: none} a, a: visited , a: link {color: # AAA; outline: none; text-decoration: underline} a: hover {color: # FFF; outline: none} a img {border: none; outline: none; text-decoration: none} object {outline: none} h1, h2, h3, h4, h5, h6 {font-family: 'Trebuchet MS', Helvetica, Arial, sans-serif; margin: 10px 0}

Each must choose the form that is most convenient for writing and organizing things. Some might use spaces, adding tabs, who ordered the properties by type or alphabetically. Everything is acceptable and should not be limited because the key is to find what we want, we can edit it and make it work.

The aesthetics of the code is not relevant at all, what matters is that it is clear to ourselves and avoid common mistakes .

ALL Properties end with a semicolon, it is true that it is not necessary to add that character in the last property of a rule but, rather put it all to get used to avoid problems.

a {/ * this is an error * /
color: # AAA
outline: none
text-decoration: underline
}

a {/ * this is fine but the latter one has no semicolon * /
color: # AAA;
outline: none;
text-decoration: underline
}

a {/ * this is OK * /
color: # AAA;
outline: none;
text-decoration: underline;
}

When a property is made up of several words, there must be a space character between them, but do not need a space between the colon character and the first word:

div {/ * this is a mistake because between the closing parenthesis and the word no-repeat missing space * /
background: # AAA url () no-repeat top left;
}

div {/ * this is fine but no space between the colon and color * /
background: # AAA url () no-repeat top left;
}

div {/ * this is OK * /
background: # AAA url () no-repeat top left;
}

Within a label <style> NEVER add other tags, only style rules are added to their properties. The same goes for the tag <b:skin> Blogger. He never includes the comments:

div {/ * this is an error * /
<! - Comment comment comment>
background: # AAA url () no-repeat top left;
}

div {/ * this is OK * /
/ * Comment comment comment * /
background: # AAA url () no-repeat top left;
}

These days, CSS is essential, even more when it comes to dynamic pages as a blog and that is what allows us to simplify the way we write tickets. The editors give us tools for that and these tools are useful but at the same time are misleading so you have to use them wisely. It is true that we can format our text with a single click and ready, put the color of the paragraphs, font type, all great but ... What if you change your mind tomorrow?

There are many templates that change frequently, it is part of the fun, part of the game and when they do, often encontarrse with a problem: the entries are wrong, that color is not the color you want, this source does not is what one would use in this new design and perhaps wondering how do I? Later, lamentantablemente, if the styles have been added in the entries there is no other choice but to edit them one by one.

Is that the CSS is just to avoid that and we are using it wrong, what we do, whenever possible, is to establish general rules, the color, fonts, everything that we normally use and put those rules and properties default along with the other. If you do not want the links are underlined establish the rule for the whole site and eventually, when we want to highlight some of them, we indicate explicitly, that kind of detail will that we should not be repeating styles for each label.

Add inline styles, ie, with a style attribute within the tag must always be a last resort, never the first.

Read More - CSS simplify complicate optimize

JQuery Fancy Transitions on Image

Your Ad Here

JqFancyTransitions is a jQuery plugin that allows you to create an image gallery with different transition effects between them.
To use it we have jQuery in the template so if you do not have it before </ head> add the library directamenete from Google:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"> </ script>

And below, the plugin, either by loading from a server where you have previously hosted:

<script type="text/javascript" src=" URL_jqFancyTransitions.js "> </ script>

or copy and paste the code and placing it between tags:

<script type="text/javascript">
//<![ CDATA [
... here copy and paste the contents of the file ...
//]]>
</ Script>


You do not need anything else, now, to use, we have several alternatives that we can see explained in the page developers but the simplest is to place the images in a DIV like this:

<div id=" migaleria ">
<img src="URL_image1" />
<img src="URL_image2" />
<img src="URL_image3" />
... and continue to add as many pictures as you want...
</ Div>


Then call the function:

<script> $ ('# migaleria'). jqFancyTransitions ({options}) </ script>

We have several galleries on the same page, each identified by an ID attribute different (in this example migaleria) and the options are parameters to be added separated by commas:

Width and height set the size
Effect is the type of transition and may be wave, zipper or curtain
Position is the position from where you start transción and may be alternate, top, bottom, alternate or curtain
Direction is the direction and may be fountainAlternate transción, left, right, alternate, random or fountain
Delay is the time delay remains the imaegn visible (default is 5000 or 5 seconds)
Strips is a number indicating the number of "pieces" in which the image desompone (default 20)
StripDelay is the time that remains visible each "piece" (default 50)

Other options let you control who can add text to images, placing them in the alt attribute:

<img src="URL_imagen1" alt="Text to show" />

TitleOpacity indicates the opacity of the text
TitleSpeed ​​is the time it takes to be shown

Alternatively, we can use images instead of links

<a href=" URL_imagen1 />

In that case, the options are two:

Navigation can be true or false and add navigation buttons.
Links can be true or false to set whether images are links or not.

In this example, the options used are the simplest and the function called this way:

<script> $ ('# migaleria'). jqFancyTransitions ({width: 640, height: 400, direction: 'random', delay: 2000, effect: 'wave'}); </ script>


Read More - JQuery Fancy Transitions on Image

Change the scroll bars with jQuery

Your Ad Here

JScrollPane is a jQuery plugin that allows us to give a visual aspect to the scroll bars of any element, something that Internet Explorer is very simple because it just use CSS but the other browsers has never been implemented, something rare and absurd but there is everything in this world.

To use it, we obviously need to load jQuery from the Google libraries so before </ head> :

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js' /> <script type='text/javascript'

Here is an optional script that will allow us to use the mouse wheel:

<script type='text/javascript' src=' URL_mousewheel.js' />

and finally the plugin itself, either in its standard version or minimized:

<script type='text/javascript' src=' URL_jscrollpane.min.js' />

If you do not want to use external files, the latter two can be added directametne in the template:

<script type='text/javascript'>
//<![ CDATA [
/ / Here paste the contents of mousewheel.js
/ / Here paste the contents of jscrollpane.min.js
//]]>
</ Script>


Like everything else, requires its own rules of style so that it is added below the minimum required although there are more definitions if we use some of the options:

<style>
. JspContainer {
overflow: hidden;
position: relative;
}
. JspPane {position: absolute;}
. JspVerticalBar {
background-color: # 000;
height: 100%;
position: absolute;
right: 0;
top: 0;
width: 16px; / * defines the width of the vertical bar * /
}
. JspHorizontalBar {
background-color: # 000;
bottom: 0;
height: 16px; / * defines the height of the horizontal bar * /
left: 0;
position: absolute;
width: 100%;
}
. JspVerticalBar *,. JspHorizontalBar * {margin: 0; padding: 0;}
/ * These are the rules for configuring the plugin * /
. JspTrack {/ * is the box where you move the slider * /
background-color: # 000;
position: relative;
}
. JspDrag {/ * is the slider itself * /
background-color: # 888;
cursor: pointer;
left: 0;
position: relative;
top: 0;
}
. JspHorizontalBar. JspTrack. JspHorizontalBar. JspDrag {
float: left;
height: 100%;
}
</ Style>

With that everything is ready so that we can use it anywhere. To do so, just to define one or more classes, for example:

</ Style>
. Scroll-pane {height: 200px; overflow: auto; width: 100%;}
. Horizontal {height: auto; max-height: 200px;}
</ Style>


<div style="width: 500px;">
<div class="scroll-pane">
<p> ....... content through ... </ P>
</ Div>
</ Div>


<div style="width: 500px;">
<div class="scroll-pane horizontal">
<p style="width: 1000px;"> ....... content through ... </ P>
</ Div>
</ Div>

And call the function using the class that we defined:

<script type="text/javascript">
$ (Function () {$ ('. Scroll-pane'). JScrollPane ();});
</ Script>

The possibilities are multiple, in the developer page there are several explanatory demos which combines the bar, you add buttons, etc.

Read More - Change the scroll bars with jQuery

Fade Out Text Effect with jQuery

Your Ad Here

Text Fade Out is an idea of CSS-Tricks that uses jQuery to create a text-blurs, cutting at a certain height and adding a button to expand.
Obviously, you must have added the jQuery library before </ head> :

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js' type='text/javascript'/>

And then the script with the effect is very short :

<script type='text/javascript'>
//<![ CDATA [
$ (Function () {
var $ a, $ ps, $ up, totalHeight;
$ (" . textfadeout-demo. textfadeout-button . ") click (function () {
totalHeight = 0
$ A = $ (this);
$ P = $ el.parent ();
$ Up = $ p.parent ();
$ Ps = $ up.find ("p: not (' . textfadeout-more ')");
$ Ps.each (function () {totalHeight + = $ (this). OuterHeight ();});
$ Up.css ({"height": $ up.height (), "max-height": 9999})
. Animate ({"height": totalHeight});
$ P.fadeOut ();
return false;
});
});
//]]>


</ Script>

Finally, the CSS that refers to the defined classes that can have different styles and with very few additions, should work on any browser, including Internet Explorer:


<style>
. Textfadeout-demo {/ * is the rectangular container * /
background-color: # 505961;
color: # EEE;
max-height: 150px; / * this sets the height * /
overflow: hidden; / * and say that "court" there, hiding the restenosis * /
padding: 20px;
position: relative;
width: 300px;
}
. Textfadeout-demo. Textfadeout-more {/ * the bottom gone * /
background-image:-moz-linear-gradient (top, transparent, # 101921)
background-image:-webkit-gradient (linear, left top, bottom left, color-stop (0, transparent), color-stop (1, # 101921));
filter: progid: DXImageTransform.Microsoft.gradient (startColorStr = '# 00101921', EndColorStr = '# FF101921')
bottom: 0;
left: 0;
padding: 30px 0;
position: absolute;
text-align: center;
width: 100%;
}
. Textfadeout-button {/ * the button to expand * /
border-top: 1px solid # 96D1F8;
background: # 65A9D7;
background:-moz-linear-gradient (top, # 3E779D, # 65A9D7)
background:-webkit-gradient (linear, left top, left bottom, from (# 3E779D) to (# 65A9D7));
filter: progid: DXImageTransform.Microsoft.gradient (startColorStr = '# FF3E779D'; EndColorStr = '# FF65A9D7');
padding: 5px 10px;
text-decoration: none;
-Moz-border-radius: 8px;
-Webkit-border-radius: 8px;
border-radius: 8px;
-Moz-box-shadow: rgba (0,0,0,1) 0 1px 0;
-Webkit-box-shadow: rgba (0,0,0,1) 0 1px 0;
box-shadow: rgba (0,0,0,1) 0 1px 0, rgba (0,0,0,90) 0 0 10px, rgba (0,0,0,90) 0 0 20px, rgba (0, 0,0,90) 0 0 30px;
text-shadow: rgba (0,0,0, 4) 0 1px 0;
}
. Textfadeout-button: hover {
border-top-color: # 28597A;
background: # 28597A;
color: # CCC;
}
. Textfadeout-button: active {
border-top-color: # 1B435E;
background: # 1B435E;
}
</ Style>

Already, now we use the three classes defined to create the HTML:


<Div class = " textfadeout-demo ">
<p> ....... the text to display ....... </ P>
<P class = " textfadeout-more "> <a href =" # "class =" textfadeout-button "> read more </ a> </ p>
</ Div>

Example :
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.



Read More - Fade Out Text Effect with jQuery

Membuat Tooltip Full CSS

Your Ad Here


Kali ini shevy mau coba share cara membuat Tooltip dengan menggunakan CSS tanpa Javascript, jadi tidak akan memberatkan loading blog. Untuk penggunaan CSSnya shevy menggunakan CSS3 jadi tidak akan support di IE6, dan hanya akan berjalan di IE8, Mozilla 3.5, dan Opera 10, browser lainnya belum di coba.

Beberapa kelebihan Tooltips ini :
  • Tidak memberatkan loading blog.
  • Full CSS tanpa menggunakan image sebagai background.
  • gampang.
Kekurangannya :
  • Tidak support Crossbrowser.
  • Hanya support dengan browser yang sudah bisa menampilkan CSS3.
Kalo penasaran pengen buat juga, okeh ikutin aja langkah2 dibawah ini :
  • Copy script CSS dibawah ini ke dalam web ato blog kamu. Penempatannya untuk blogger silahkan masukan script dibawah diantara script CSS yang lainnya. Atau diatas kode ]]>.
a.Tooltip{
position:relative;
z-index:24;
color:#fff;
font-weight:bold;
text-decoration:none;
}

a.Tooltip span{
display: none;
}

a.Tooltip:hover{
z-index:50;
text-decoration:none;
}

a.Tooltip:hover span{
display:block;
position:absolute;
left:0;
padding: 5px 2px 5px 5px;
width:200px;
min-height:50px;
color:#fff;
font: Georgia, "Times New Roman", Times, serif;
font-size:10px;
font-weight:bold;
text-align: center;
background-color: rgba(60, 132, 198, 0.8);
border-top-color: #8ba2c1;
border-right-color: #5890bf;
border-bottom-color: #4f93ca;
border-left-color: #768fa5;
-webkit-box-shadow: rgba(66, 140, 240, 0.5) 0px 10px 16px;
-moz-box-shadow: rgba(66, 140, 240, 0.5) 0px 10px 16px;
background-image: -webkit-gradient(linear, 0% 0%, 0% 90%, from(rgba(28, 91, 155, 0.8)), to(rgba(108, 191, 255, .9)));
background-image: -moz-linear-gradient(rgba(28, 91, 155, 0.8) 0%, rgba(108, 191, 255, .9) 90%);
-moz-border-radius:5px;
-webkit-border-radius:5px;
vertical-align:text-bottom;
text-transform:none;
}
a.Tooltip:hover span img {
width:120px;
height:100px;
padding:2px 2px 2px 2px;
text-align:left;
text-transform:none;
border:1px solid #CCCCCC;
}

  • Kemudian simpan perubahan.

Cara Menggunakannya

Untuk memunculkan tooltipsnya, silahkan ikuti langkah2 dibawah :
  • pada saat akan memasukan link pada Html atau template, tambahkan beberapa tag seperti dibawah ini :
Link Normal (Tanpa Tooltip)
<a href="http://shevy-blog.blogspot.com/" target="_blank" title="shevy-blog">shevy-blog</a>


Link Dengan Tooltip
<a class="tooltip" href="URL BLOG KAMU">NAMA LINK
    <span>DESKRIPSI TEXT KAMU</span>
    <img alt="title gambar" src="URL GAMBAR KAMU" />
    </a>

Contoh:
<a class="tooltip" href="http://shevy-blog.blogspot.com">shevy-blog
    <span>shevy-blog | Monetize Your Blog</span>
    <img alt="shevy-blog | Monetize Your Blog" src="Http://.../image/shevy-blog.jpg" />
    </a>

Keterangan Warna :
  • Setiap kamu akan membuat link dengan fitur tooltip, kamu harus memasukan tag class="tooltip", seperti contoh diatas, tag yang shevy tandai dengan warna biru.
  • Untuk tag yang shevy tandai dengan warna hijau, adalah untuk deskripsi atau keterangan atau tulisan apapun yang akan muncul pada kotak tooltips nanti.
  • Sedangkan tag yang shevy tandai dengan warna ungu, adalah untuk memasukan gambar thumbnail pada tooltip. gunakan tag ini jika kamu mau memasukan gambar pada tooltip-nya.

Nah kayaknya cukup tuh keterangannya, apabila ada pertanyaan, atau kesulitan silahkan komen aja ya...

Untuk melihat Contoh Live nya silahkan klik link dibawah ini:

Read More - Membuat Tooltip Full CSS

Menambahkan Efek Text Berjalan (Marquee) Pada Blog

Your Ad Here

Efek teks berjalan atau efek marquee, merupakan efek teks yang sangat sederhana namun efek tersebut bisa membuat blog kamu tampil beda. Berikut contoh dari efek Marquee...

Efek Marquee Kiri Ke Kanan / Kanan Ke Kiri


Efek Marquee Dari kanan ke kiri


Berikut script untuk membuat efek seperti di atas :
Catatan : Ganti tulisan Efek Marquee Dari kiri ke kanan dengan teks kamu.


Efek Marquee Dari kiri ke kanan
Untuk membuat efek Efek Marquee Dari Kanan ke kiri, scriptnya sama seperti diatas, kamu tinggal mengganti script direction="right" ganti dengan direction="Left".


Efek Marquee Dari Atas Ke Bawah / Bawah Ke Atas


Efek Marquee Dari Atas ke Bawah

Berikut script untuk membuat efek seperti di atas : 
 


Efek Marquee Dari Bawah ke atas

Untuk membuat efek Efek Marquee Dari bawah ke atas , scriptnya sama seperti diatas, kamu tinggal mengganti script direction="down" ganti dengan direction="up".

Met Mencoba,,,

Read More - Menambahkan Efek Text Berjalan (Marquee) Pada Blog

Script Refresh Blog Secara Otomatis

Your Ad Here

Artikel ini akan menjelaskan bagaimana membuat script yang bisa merefresh blog secara otomatis. Mungkin ada sebagian blogger yang membutuhkannya, berikut script dan langkahnya :
  • Login ke akun blogger kamu, kemudian masuk dashboard, masuk ke menu layout, pilih tab Edit HTML.
  • Cari script ini  (yang berwarna merah).
<head>
  • Copy kode script dibawah dan simpan setelah kode <head>
<meta HTTP-EQUIV='refresh' content='15;URL=http://blogkamu.blogspot.com'/>

Catatan:  Ganti http://blogkamu.blogspot.com dengan alamat blog kamu.
Angka 15 merupakan delay time, angka tersebut bisa kamu ganti sesuai keinginan kamu.

  • Sekarang simpan, lihat hasilnya,,,
Semoga bermanfaat,,,



    Read More - Script Refresh Blog Secara Otomatis

    Determining browser type and version Script

    Your Ad Here

    Here’s another, more advanced, example that determines which browser the user has and lets you execute code depending on browser type to display the browser version.

    This example puts to use the if and else statements as well as several built-in JavaScript functions that handle strings. In JavaScript, text strings are considered objects, and they have some built-in properties and methods that make life easier.

    Here’s what this example uses:

  • The length property gives you the length of the string, in characters

  • The indexOf method searches for the occurrence of a substring and gives you the location of the first match — or –1 if there was no match. (The first character of a string is considered character 0.)

  • The substring method lets you extract a substring from a larger string. You can pass this method the start and end locations of the substring that you want to extract.

  • This example searches the navigator.userAgent property, which, as I introduce in "Which browser are you using?", holds the browser name and version, extracts that information, and displays it. (You really don’t have to memorize the string functions here — I put together this example because it’s often important in Ajax programming to know what browser and version the user has.).


    The script looks like.

    <html>
    <head>
    <title>
    Determining your browser
    </title>
    <script language=”javascript”>
    var versionBegin, versionEnd
    function checkBrowser()
    {
    if(navigator.appName == “Netscape”) {
    if(navigator.userAgent.indexOf(“Firefox”) > 0) {
    versionBegin = navigator.userAgent.indexOf(“Firefox”) +
    “Firefox”.length + 1;
    versionEnd = navigator.userAgent.length;
    document.getElementById(“targetDiv”).innerHTML =
    “You have Firefox “ +
    navigator.userAgent.substring(versionBegin, versionEnd);
    }
    }
    if (navigator.appName == “Microsoft Internet Explorer”) {
    versionBegin = navigator.userAgent.indexOf(“MSIE “) +
    “MSIE “.length;
    if(navigator.userAgent.indexOf(“;”, versionBegin) > 0) {
    versionEnd = navigator.userAgent.indexOf(“;”, versionBegin);
    } else {
    versionEnd = navigator.userAgent.indexOf(“)”, versionBegin)
    + 2;
    }
    document.getElementById(“targetDiv”).innerHTML =
    “You have Internet Explorer “ +
    navigator.userAgent.substring(versionBegin, versionEnd);
    }
    }
    </script>
    </head>
    <body onload=”checkBrowser()”>
    <h1>Determining your browser</h1>
    <div ID=”targetDiv”></div>
    </body>
    </html>


    You can see the results in picture below, where the user is using Firefox 1.0.6. Using code like this, you can figure out what browser the user has — and whether the browser he has doesn’t do what you want, put in some kind of workaround.
    One thing computers are good at is doing the same kind of task over and over, and JavaScript helps out here with loops. I take a look at them in the following
    section to set the stage for working with buttons in Web pages that the user can click.



    Read More - Determining browser type and version Script

    Explanation of AJAX

    Your Ad Here

    How Does Ajax Work?

    With Ajax, Web applications finally start feeling like desktop applications to your users. That’s because Ajax enables your Web applications to work behind the scenes, getting data as they need it, and displaying that data as you want. And as more and more people get fast Internet connections, working behind the scenes to access data is going to become all the rage. Soon,

    it’ll be impossible to distinguish dedicated desktop software from software that’s actually on the Internet, far from the user’s machine. To help you understand how Ajax works, the following sections look at Ajax from a user’s and a programmer’s perspective.



    A user’s perspective

    To show you how Ajax makes Web applications more like desktop applications, I’ll use a simple Web search as an example. When you open a typical search engine, you see a text box where you type a search term. So say you type Ajax XML because you’re trying to figure out what XML has to do with Ajax. Then, you click a Search the Web button to start the search. After that, the browser flickers, and a new page is loaded with your search results.


    A developer’s perspective

    In the article "Ajax: A New Approach to Web Applications" (www.adaptivepath.com/publications/essays/archives/000385.php), Jesse James Garrett, who was the first to call this technology Ajax, made important insights about how it could change the Web. He noted that although innovative

    new projects are typically online, Web programmers still feel that the rich capabilities of desktop software were out of their reach. But Ajax is closing the gap.

    So how does Ajax do its stuff? The name Ajax is short for Asynchronous JavaScript and XML, and it’s made up of several components:

    Browser-based presentation using HTML and Cascading Style Sheets (CSS).

    - Data stored in XML format and fetched from the server

    - Behind-the-scenes data fetches using XMLHttpRequest objects in the browser

    - JavaScript to make everything happen

    JavaScript is the scripting language that nearly all browsers support, which will let you fetch data behind the scenes, and XML is the popular language that lets you store data in an easy format.


    Here’s an overview of how Ajax works:


    1. In the browser, you write code in JavaScript that can fetch data from the server as needed.

    2. When more data is needed from the server, the JavaScript uses a special item supported by browsers, the XMLHttpRequest object, to send a request to the server behind the scenes — without causing a page refresh.

    The JavaScript in the browser doesn’t have to stop everything to wait for that data to come back from the server. It can wait for the data in the background and spring into action when the data does appear (that’s called asynchronous data retrieval).

    3. The data that comes back from the server can be XML, or just plain text if you prefer. The JavaScript code in the browser can read that data and put it to work immediately. That’s how Ajax works — it uses JavaScript in the browser and the XMLHttpRequest object to communicate with the server without page refreshes, and handles the XML (or other text) data sent back from the server. I explain how all these components work together in more detail.


    This also points out what you’ll need to develop Web pages with Ajax. You’ll add JavaScript code to your Web page to fetch data from the server, and you’ll need to store data and possibly write server-side code to interact with the browser behind the scenes. In other words, you’re going to need access to an online server where you can store the data that you will fetch using Ajax. Besides just storing data on the

    server, you might want to put code on the server that your JavaScript can interact with. For example, a popular server-side language is PHP, and many of the examples in this book show how you can connect to PHP scripts on Web servers by using Ajax. Getting you up to speed on that language if you’re interested. So you’re going to need a Web

    server to store your data on, and if you want to run server-side programs as well, your server has to support server-side coding for the language you want to work with (such as PHP).


    Read More - Explanation of AJAX

    Membuat Efek Salju Dengan JavaScript

    Your Ad Here

    Mikum,,,
    Kali ni gw mo share dikit tentang bikin efek salju pada blog ato web dengan menggunakan javascript. Tanpa panjang lebar lagi...
    langsung aja ya...
  • Langkah Pertama
    • copy paste script di bawah ini.


    • Catatan : Pada kode var maxitems=25, Bisa kamu ganti dengan angka berapapun terserah. Kode itu untuk menentukan berapa banyak jumlah salju yang akan turun.

    • Jika Sudah tinggal masukan script diatas kedalam blog atau situs kamu.

    met mencoba...


    Read More - Membuat Efek Salju Dengan JavaScript

    Rollover Images in JavaScript

    Your Ad Here

    To do so is to copy or copy the JavaScript code below into your web pages. Then place it before the tag <HEAD>, or placed before the position of the image.

    <SCRIPT TYPE="text/javascript"> <!-- // copyright 1999 Idocs, Inc. http://www.idocs.com/tags/ // Distribute this script freely, but please keep this // notice with the code. var rollOverArr=new Array(); function setrollover(OverImgSrc,pageImageName) { if (! document.images)return; if (pageImageName == null) pageImageName = document.images[document.images.length-1].name; rollOverArr[pageImageName]=new Object; rollOverArr[pageImageName].overImg = new Image; rollOverArr[pageImageName].overImg.src=OverImgSrc; } function rollover(pageImageName) { if (! document.images)return; if (! rollOverArr[pageImageName])return; if (! rollOverArr[pageImageName].outImg) { rollOverArr[pageImageName].outImg = new Image; rollOverArr[pageImageName].outImg.src = document.images[pageImageName].src; } document.images[pageImageName].src=rollOverArr[pageImageName].overImg.src; } function rollout(pageImageName) { if (! document.images)return; if (! rollOverArr[pageImageName])return; document.images[pageImageName].src=rollOverArr[pageImageName].outImg.src; } //--> </SCRIPT>


    copy the code below again to put a picture on your pages.

    <a onmouseover="rollover('home')" onmouseout="rollout('home')" href="http://pcguru.okihelfiska.net"><img alt="PC Guru" src="http://www.okihelfiska.net/data/roll-out.png" border="0" name="home" /></a> <SCRIPT TYPE="text/javascript"> <!-- setrollover("http://www.okihelfiska.net/data/roll-over.png"); //--> </SCRIPT>


    Finished, Save your page, and then refresh.



    NB: This script will be problematic if used in the BLOG, should only be used on the Website only.

    Read More - Rollover Images in JavaScript

    Install Joomla In Localhost

    Your Ad Here

    OK, here I will explain about How do I install Joomla on the server at localhost.

    1. You install the package apache Friends XAMPP in which it can be downloaded click here.
    package for windows, Linux for a click here to download.

    2. Then what if you have to install XAMPP, you all its good service ftpzila the apache, mysql.

    3. Then you download the Joomla package file download it here

    4. After you download the Joomla package is no package file extract it to a folder, ie: Joomla, Joomla folder and then you have a copy (for windows) to c: / program files / xampp / htdocs /
    For Linux you create a new folder eg: Joomla and then extract the package in your joomla
    / var / www / Joomla
    (folder that you created earlier), then change the file ownership is the way:

    root @ linuxku: / home / Nisa # cd / var / www /
    >root @ linuxku: / var / www # find / var / www / Joomla /-type
    d-exec chmod 755 () \;
    root @: / var / www # find / var / www / Joomla /-type
    f-exec chmod 644 () \;
    root @ linuxku: / var / www # chown-R www-data: wwwdata
    Joomla /


    5. Then you open your browser be it IE or mozilla, type
    http://localhost:80/Joomla (according to the folder you created earlier). Do not forget service apache
    mysql
    and run it on.

    6. It will appear:
    Press Next button, the display of Joomla License:

    7. Next click the More button, it will appear:

    contents Hostname: localhost
    My content Sql User Name: root
    empty password
    My SQL database contents Name is up for what you want, then click the Next button.
    it will appear as follows:



    8. fill in the name of the site you want to create eg situsku, and then click the Next button, it will appear as follows:
    fill in your email address, and change its password is, the others leave in the default situation.
    Then click the Back button Next, it will appear as follows:

    9. The sign suggests that this means that you have completed Joomla in the install, and then on the folder c: / program files / XAMPP / htdocs / Joomla (folder that you created) delete installation folder, then open your browser again and run it or type http:/ / localhost: 80/Joomla, if you want to customize your site you choose to stay administrator: input user name: admin and password that you have content at the time of earlier Joomla installation. And If you want to upload your Joomla to the internet you can use ftp fantatisco or whatever depending on where you are hosting what it provides. If you want to create a joomla site for free you can visit the www.freehostia.com, in the installation guide on the freehostia time, want to come home tired first. Happy to try and work.

    Read More - Install Joomla In Localhost

    Cara Install XAMPP

    Your Ad Here

    XAMPP merupakan sebuah paket instalasi untuk PHP, APACHE dan MySQL. Dengan menggunakan XAMPP, kita tidak perlu lagi repot menginstall ketiga software itu secara terpisah. XAMPP dapat di download di

    http://www.apachefriends.org/en/index.html.

    Berikut ini adalah cara menginstall XAMPP.

  • Jalankan file xampp-win32-1.4.12-installer.exe (atau versi lainnya)


  • Kemudian akan tampil pilihan untuk memilih bahasa ketika proses instalasi XAMPP berjalan. Silakan pilih  bahasa Indonesian atau English.

    Cara Install XAMPP

  • Proses instalasi akan dimulai. Klik Next untuk memulainya.



  • Akan muncul lisensi software. Silahkan membacanya jika anda mau, tetapi saya lebih suka untuk tidak membacanya karena terlalu banyak. Klik Saya Setuju / I Agree untuk melanjutkan.



  • Cara Install XAMPP

  • Selanjutnya silakan anda pilih lokasi install untuk XAMPP. Kemudian klik install



  • Cara Install XAMPP

  • Tunggu beberapa saat sampai proses instalasi selesai.


  • Jika proses installasi XAMPP telah selesai, Langkah selanjutnya adalah menjalankan servicenya.



  • Jalankan XAMPP Control Panel yang ada di desktop. Atau anda juga dapat menjalankan XAMPP Control Panel dari menu Start -> All Programs -> apachefriends -> xampp -> xampp control panel.



  • Cara Install XAMPP

  • Nyalakan Apache dan Mysql dengan mengklik tombol Start. Buka web browser anda, lalu ketikkan http://localhost. Jika tampilannya seperti di bawah ini, maka apache sudah terinstall dengan benar.

  • Met Mencoba deh...

    Cara Install XAMPP

    Read More - Cara Install XAMPP

    Differences in HTML and XHTML

    Your Ad Here

    we often see the website once-website on the internet, how do we differentiate between a standard html document and xhtml?

    one example, if we view the source website, the difference is fundamental:

  • HTML


  • <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html>


  • The Tag can write in with letters large and small: <html>, <body>, <img>, <pre>, <br>

  • There are some tags that may be not closed: <li>, <br>



  • XHTML


  • <!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">
     


  • Tags must be written with small letters: <html>, <body>, <img>, <pre>

  • All tags must be closed, if a tag like the break, given signs / before the closing tag: <br />, /> <input, <img />

  • Read More - Differences in HTML and XHTML

    Making Random Images With JavaSript

    Your Ad Here

    Random Image with Javascript, Follow this step :

    1. The first step prepare an image hosting account, no matter where it's allowed.

    2. Then copy paste this script to your web.

    <script language="javascript">
    <!--
    var bdis = "<img src=\"";
    var edis = " style=\"border:none;\">";
    var rnumb = "";
    var img = "";

    rnumb += Math.floor(Math.random()*5);
    img = rnumb;

    if (img == "0") {document.write(bdis+ "http://www.imagehosting.com/picture0.jpg\"" +edis);}
    if (img == "1") {document.write(bdis+ "http://www.imagehosting.com/picture1.jpg\"" +edis);}
    if (img == "2") {document.write(bdis+ "http://www.imagehosting.com/picture2.jpg\"" +edis);}
    if (img == "3") {document.write(bdis+ "http://www.imagehosting.com/picture3.jpg\"" +edis);}
    if (img == "4") {document.write(bdis+ "http://www.imagehosting.com/picture4.jpg\"" +edis);}
    // -->
    </script>



    3. Save changes.

    The code is red it can be customized themselves. If you have 10 pictures will be displayed in turn the number "5" is replaced with "10". While the code can be added to own as much as possible, followed by a number from 0 to 9.

    Read More - Making Random Images With JavaSript

    Decrypting DES in ASP.Net

    Your Ad Here

    Decrypting the Information Is as Simple as Entering a Password and an
    Encrypted Message. Like this.:

    <%@ Import Namespace=”System.Security.Cryptography” %>

    <%@ Import Namespace=”System.Text” %>


    <script language=”VB” runat=”server”>


    Dim aConstantIV() as Byte = _


    { &Haa, &Hbb, &Hcc, &Hdd, &Hee, &Hff, &H12, &H78 }


    Sub btnSubmit_OnClick(source as Object, e as EventArgs)


    Dim strDecryptedText as String = DESDecrypt(txtContents.Text)


    lblResults.Text = “<b>Decrypted String:</b><xmp>” & _


    strDecryptedText & “</xmp>”


    End Sub


    Function GetKey(strPassword as String) as Byte()


    ‘Ensure that the strPassword string is at least 8 characters long


    strPassword = strPassword.PadRight(9)


    ‘Now, convert the string into a byte array


    Dim objUTF8 as New UTF8Encoding()


    GetKey = objUTF8.GetBytes(strPassword.Substring(1, 8))


    End Function


    Function DESDecrypt(strDecrypt as String) as String


    Dim aKey() as Byte


    Dim objUTF8 as New UTF8Encoding()


    ‘Convert the password into a byte array


    aKey = GetKey(txtPassword.Text)


    ‘Create an instance of the DES class


    Dim objDES as DES = DES.Create()


    objDES.Key = aKey


    objDES.IV = aConstantIV


    ‘Convert the string into an array of bytes


    Dim i as Integer


    strDecrypt = strDecrypt.Trim()


    Dim aStringBits() as String = strDecrypt.split(“ “)


    Dim aByteData(aStringBits.Length) as Byte


    For i = 0 to aStringBits.Length - 1


    aByteData(i) = aStringBits(i).ToByte()


    Next i


    try


    Dim objStreamDec as SymmetricStreamDecryptor =


    objDES.CreateDecryptor()


    Dim objCryptoStream as New CryptoMemoryStream()


    objStreamDec.SetSink(objCryptoStream)


    objStreamDec.Write(aByteData)


    objStreamDec.CloseStream()


    ‘Represent the byte array as a string


    DESDecrypt = objUTF8.GetString(objCryptoStream.Data)


    catch e as Exception


    DESDecrypt = “Invalid password entered!”


    end try


    End Function


    </script>


    <html>


    <body>


    <form runat=”server”>


    <h1>Encrypt Information!</h1>


    <b>Enter the Password:</b>


    <asp:textbox id=”txtPassword” TextMode=”Password” runat=”server” />


    <br><b>Enter the text to decrypt:</b><br>


    <asp:textbox id=”txtContents” TextMode=”MultiLine” runat=”server”


    Columns=”50” Rows=”6” />


    <br><asp:button id=”btnSubmit” runat=”server” Text=”Decrypt!”


    OnClick=”btnSubmit_OnClick” />


    <p>


    <asp:label id=”lblResults” runat=”server” />


    </form>


    </body>


    </html>



    Even the DESDecrypt function is similar to the DESEncrypt function. A DES class instance is
    created on line 30, and its Key and IV properties are set to the value returned by the GetKey
    function and the constant initialization vector. On lines 35 through 41, the encrypted string is
    converted into a Byte array. Recall that the encrypted string consists of numerical values separated
    by spaces. To turn this back into a Byte array, the split method of the String class is
    used to break up the numerical values into a String array (line 37). A Byte array is then created
    with the appropriate size (line 38). Finally, in lines 39 through 41, a loop is used to build up
    the Byte array one byte at a time.
    Next, the decryption process is started. Rather than using a SymmetricStreamEncryptor
    instance, we use a SymmetricStreamDecryptor instance instead (line 44). After line 49, the
    objCryptoStream’s Data property contains, in Byte array format, the decrypted data. The
    UTF8Encoding class’s GetString() method is used to convert this into a string (line 52).
    If the user enters an invalid password, a CryptographicException exception is thrown. The
    try ... catch block spanning from lines 43 through 55 is in place to catch such an exception.
    If it occurs, the catch block starting on line 53 begins executing, and an “Invalid
    password entered!” message is returned (line 54).

    Read More - Decrypting DES in ASP.Net

    Encrypted DES format in ASP.Net

    Your Ad Here

    The .NET Framework also contains a TripleDES class, which is an improved version of
    the old DES standard. TripleDES takes longer to encrypt and decrypt information,
    but is much more secure than DES.
    A Plain-Text Message Is Encrypted with the DES Algorithm Using a User-
    Specified Password.

    <%@ Import Namespace=”System.Security.Cryptography” %>

    <%@ Import Namespace=”System.Text” %>


    <script language=”VB” runat=”server”>


    Dim aConstantIV() as Byte = _


    { &Haa, &Hbb, &Hcc, &Hdd, &Hee, &Hff, &H12, &H78 }


    Sub btnSubmit_OnClick(source as Object, e as EventArgs)


    Dim strEncryptedText as String = DESEncrypt(txtContents.Text)


    lblResults.Text = “<b>Encrypted String:</b><xmp>” & _


    strEncryptedText & “</xmp><p><i>” & _


    “Copy this encrypted information to the clipboard! To decrypt“


    & _


    “it visit <a href=””Listing2.11.2.aspx””>Listing2.11.2.aspx</a>”


    End Sub


    Function GetKey(strPassword as String) as Byte()


    ‘Ensure that the strPassword string is at least 8 characters long


    strPassword = strPassword.PadRight(9)





    ‘Now, convert the string into a byte array


    Dim objUTF8 as New UTF8Encoding()


    GetKey = objUTF8.GetBytes(strPassword.Substring(1, 8))


    End Function


    Function DESEncrypt(strEncrypt as String) as String


    Dim aKey() as Byte


    Dim objUTF8 as New UTF8Encoding()


    ‘Convert the password into a byte array


    aKey = GetKey(txtPassword.Text)


    ‘Create an instance of the DES class


    Dim objDES as DES = DES.Create()


    objDES.Key = aKey


    objDES.IV = aConstantIV


    Convert the string into an array of bytes


    Dim aByteData() as Byte = objUTF8.GetBytes(strEncrypt)


    Dim objStreamEnc as SymmetricStreamEncryptor = objDES.CreateEncryptor()


    Dim objCryptoStream as New CryptoMemoryStream()


    objStreamEnc.SetSink(objCryptoStream)


    objStreamEnc.Write(aByteData)


    objStreamEnc.CloseStream()


    Represent the byte array as a string


    Dim i as Integer


    Dim strTmp as String = “”


    For i = 0 to objCryptoStream.Data.Length - 1


    strTmp &= objCryptoStream.Data(i).ToString() & “ “


    Next i


    DESEncrypt = strTmp


    End Function


    </script>


    <html>


    <body>


    <form runat=”server”>


    <h1>Encrypt Information!</h1>


    <b>Enter a Password:</b>


    <asp:textbox id=”txtPassword” TextMode=”Password” runat=”server” />


    <br><b>Enter text to encrypt:</b><br>


    <asp:textbox id=”txtContents” TextMode=”MultiLine” runat=”server”


    Columns=”50” Rows=”6” />


    <br><asp:button id=”btnSubmit” runat=”server” Text=”Encrypt!”


    OnClick=”btnSubmit_OnClick” />


    <p>


    <asp:label id=”lblResults” runat=”server” />


    </form>


    </body>


    </html>



    Recall that cryptography algorithms generally require two inputs: a key and the information to
    be encrypted. The DES algorithm (as with many other symmetric algorithms) also require a
    third input, an initialization vector (IV) that is used to get the encryption and decryption process started. This information, as well as the key, must be in the form of a Byte array.

    Read More - Encrypted DES format in ASP.Net

    Drop Down Menu Dengan CSS

    Your Ad Here

    Kali ini gw mau menjelaskan cara bikin Drop Down Menu pada web dengan menggunakan Pure CSS murni…


    Ok Langsung aja ya…


    Langkah Pertama

  • 1. Buka NotePad, Kemudian copy paste kode script di bawah ini. Lalu Simpan dengan nama "dropdown.css". Ingat waktu temen2 save file dropdown.css, harus berekstensi CSS bukan TXT.
  • @charset "UTF-8";
    ul.dropdown,
    ul.dropdown li,
    ul.dropdown ul {
    list-style: none;
    margin: 0;
    padding: 0;
    }
    ul.dropdown {
    position: relative;
    z-index: 597;
    float: left;
    }
    ul.dropdown li {
    float: left;
    line-height: 1.3em;
    vertical-align: middle;
    zoom: 1;
    }
    ul.dropdown li.hover,
    ul.dropdown li:hover {
    position: relative;
    z-index: 599;
    cursor: default;
    }
    ul.dropdown ul {
    visibility: hidden;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 598;
    width: 100%;
    }
    ul.dropdown ul li {
    float: none;
    }
    ul.dropdown ul ul {
    top: 1px;
    left: 99%;
    }
    ul.dropdown li:hover > ul {
    visibility: visible;
    }
    ul.dropdown li.rtl ul {
    top: 100%;
    right: 0;
    left: auto;
    }
    ul.dropdown li.rtl ul ul {
    top: 1px;
    right: 99%;
    left: auto;
    }


    Langkah Kedua

  • 1. Buka NotePad lagi, Kemudian copy paste kode script di bawah ini. Lalu Simpan dengan nama "default1.css".


  • @import "default.css";
    ul.dropdown a,
    ul.dropdown span {
    display: block;
    padding: 5px 30px;
    }
    ul.dropdown li {
    padding: 0;
    }
    ul.dropdown ul a,
    ul.dropdown ul span {
    padding: 8px;
    }
    ul.dropdown *.dir {
    padding: 5px 30px;
    }
    ul.dropdown ul *.dir {
    padding: 8px 30px 8px 8px;
    }
    ul.dropdown ul a {
    width: 133px;
    }
    ul.dropdown ul a.dir {
    width: 111px;
    }
    ul.dropdown *.open {
    background-color: #3d3d3d;
    }
    ul.dropdown ul *.open {
    background-color: #4c4c4c;
    color: #fff;
    }
    ul.dropdown ul ul *.open {
    background-color: #595959;
    color: #fff;
    }
    ul.dropdown a.open:hover {
    background-color: #4698ca;
    color: #fff;
    }
    ul.dropdown ul a.open:hover {
    color: #fff;
    }
    ul.dropdown li:hover > *.dir {
    background-color: #3d3d3d;
    }
    ul.dropdown ul li:hover > *.dir {
    background-color: #4c4c4c;
    }
    ul.dropdown ul ul li:hover > *.dir {
    background-color: #595959;
    color: #fff;
    }
    ul.dropdown li:hover > a.dir:hover {
    background-color: #4698ca;
    color: #fff;
    }
    ul.dropdown ul li:hover > a.dir:hover {
    color: #fff;
    }


    Kemudian buat lagi file CSS dengan script seperti dibawah ini. Simpan dengan nama file Default.css

    @charset "UTF-8";
    @import "helper.css";
    ul.dropdown li {
    padding: 5px;
    }
    ul.dropdown *.dir {
    padding-right: 30px;
    background-image: none;
    background-position: 100% 50%;
    background-repeat: no-repeat;
    }
    ul.dropdown ul *.dir {
    padding-right: 15px;
    background-position: 100% 50%;
    background-repeat: no-repeat;
    }
    ul.dropdown ul ul *.dir {
    }
    ul.dropdown-vertical *.dir {
    }
    ul.dropdown-vertical-rtl *.dir {
    padding-right: 15px;
    background-position: 0 50%;
    }
    ul.dropdown {
    font: bold 17px/normal Arial, Helvetica, sans-serif;
    }
    ul.dropdown li {
    background-color: #333;
    color: #fff;
    }
    ul.dropdown li.hover,
    ul.dropdown li:hover {
    }
    ul.dropdown a:link,
    ul.dropdown a:visited { color: #fff; text-decoration: none;}
    ul.dropdown a:hover {
    border-top-color: #5db1e0 !important;
    border-left-color: #5db1e0;
    background-color: #4498c7;
    color: #fff;
    }
    ul.dropdown ul a.dir:hover {
    background-color: #4698ca;
    color: #fff;
    }
    ul.dropdown a:active {
    color: #fff;
    }
    ul.dropdown ul {
    left: auto;
    right: 0;
    width: 150px;
    margin-top: -1px;
    border-top: 1px solid #1a1a1a;
    border-left: solid 1px #4c4c4c;
    font: bold 11px/1em Tahoma, Geneva, Verdana, sans-serif;
    }
    ul.dropdown ul li {
    background-color: #3a3a3a;
    }
    ul.dropdown ul ul {
    top: 0;
    right: auto;
    left: 100%;
    margin-top: 0;
    border-top: none;
    border-left: none;
    font-weight: normal;
    }
    ul.dropdown ul ul li {
    background-color: #4c4c4c;
    }
    ul.dropdown ul ul ul li {
    background-color: #595959;
    }
    ul.dropdown li a,
    ul.dropdown *.dir {
    border-style: solid;
    border-width: 1px;
    border-color: #404040 #1a1a1a #1a1a1a #505050;
    }
    ul.dropdown ul li a,
    ul.dropdown ul *.dir { border-color: #4a4a4a #242424 #242424; border-left: none; }
    ul.dropdown ul ul li a,
    ul.dropdown ul ul *.dir { border-color: #595959 #333 #333; }
    ul.dropdown ul ul ul li a,
    ul.dropdown ul ul ul *.dir { border-color: #767676 #404040 #404040; }
    #n-movies { width: 250px; text-align: center; }
    #n-movies ul { right: auto; left: 0; width: 249px; text-align: left; }
    #n-movies ul ul { left: 249px; width: 150px; }
    #n-movies ul a { width: 232px; }
    #n-movies ul a.dir { width: 210px; }
    #n-movies ul ul a { width: 133px; }
    #n-movies ul ul a.dir { width: 111px; }
    #n-movies ul ul ul { left: 100%; }


    Buat file Css lagi dengan nama helper.css, dengan script seperti dibawah ini.

    * { margin: 0; padding: 0; }
    body { padding: 50px; background: #4c4c4c url(images/grad1.png) 0 0 repeat-x; color: #d9d9d9; font: 14px/normal Tahoma, Arial, Helvetica, sans-serif; }
    h1 { margin-bottom: .5em; border-bottom: solid 1px #d9d9d9; font-family: Arial, Helvetica, sans-serif; font-weight: normal; font-size: 180%; text-indent: 5px; letter-spacing: -1px; }
    cite { float: right; }
    ul.classic { list-style: disc; margin-bottom: 1em; padding-left: 2em; }
    div.section { clear: both; padding-top: 50px; }
    .table1 { float: right; margin-bottom: 2em; border: solid 1px #eee; }
    .table1 caption { color: #fff; text-align: center; padding-bottom: 5px; }
    .table1 th, .table1 td { padding: 7px; }
    .table1 th, .table1 thead td { background-color: lightyellow; color: #000; }
    .table1 tbody td { background-color: #fff; color: #000; }
    .table1 tbody th { text-align: right; }


    Langkah Ketiga

  • 1. Temen2 musti masukin script HTML dibawah ini pada file HTML temen2. Untuk masalah tata letaknya, Silakan sesuaikan sendiri. Berikut Scriptnya :
  • Masukan script ini diatas </head> :

    <link href="test_drop/dropdown.css" media="all" rel="stylesheet" type="text/css" />
    <link href="test_drop/default1.css" media="all" rel="stylesheet" type="text/css" />


    Pada Script href="test_drop/dropdown.css", Silakan sesuaikan dengan tempat dimana temen2 menyimpan file dropdown.CSS dan default1.CSS.

    Bila sudah, kita lanjut lagi... Masukan script dibawah ini pada file HTML temen2, dan sesuaikan sendiri untuk tata letak dan nama dari menu tersebut.

    <ul id="nav" class="dropdown dropdown-horizontal">
    <li id="n-home"><a href="./">Home</a></li>
    <li id="n-music"><a href="./" class="dir">Musik Klip</a>
    <ul>
    <li class="first"><a href="./" class="dir">Artis</a>
    <ul>
    <li class="first"><a href="./">semua Artis</a></li>
    <li><a href="./">paporit</a></li>
    <li><a href="./">Populer</a></li>
    <li><a href="./">Baru</a></li>
    </ul>
    </li>
    <li><span class="dir">Music Videos</span>
    <ul>
    <li class="first"><a href="./">MTV.com Video Picks</a></li>
    <li><a href="./">Video Premieres</a></li>
    <li><a href="./">Most Popular Videos</a></li>
    <li><a href="./">Playlists</a></li>
    <li><a href="./">Top Videos by Year</a></li>
    <li><a href="./">Live Performances</a></li>
    <li><a href="./">The Big Ten</a></li>
    <li><a href="./">Headbangers Ball</a></li>
    <li><a href="./">Playlibs</a></li>
    <li><a href="./">Subterranean</a></li>
    <li><a href="./">Sucker Free</a></li>
    <li><a href="./">Video Remixer</a></li>
    </ul>
    </li>
    <li><a href="./">Your Music on MTV?</a></li>
    <li><a href="./" class="dir">Lyrics</a>
    <ul>
    <li class="first"><a href="./">Search for Lyrics</a></li>
    <li><a href="./">Play Lyrics Game</a></li>
    </ul>
    </li>
    <li><span class="dir">Music Blogs</span>
    <ul>
    <li class="first"><a href="./">Buzzworthy Blog</a></li>
    <li><a href="./">Headbangers Blog</a></li>
    <li><a href="./">Play | Rhapsody Blog</a></li>
    <li><a href="./">Subterranean Blog</a></li>
    <li><a href="./">Sucker Free Blog</a></li>
    <li><a href="./">You R Here Blog</a></li>
    </ul>
    </li>
    <li><span class="dir">Music Shows</span>
    <ul>
    <li class="first"><a href="./">Dew Circuit Breakout</a></li>
    <li><a href="./">Discover &amp; Download</a></li>
    <li><a href="./">MTV Live</a></li>
    <li><a href="./">Spankin' New Music Week</a></li>
    <li><a href="./">TRL</a></li>
    <li><a href="./">Unplugged</a></li>
    <li><a href="./">Yo! MTV Raps</a></li>
    </ul>
    </li>
    <li><span class="dir">Songs</span>
    <ul>
    <li class="first"><a href="./">The Leak |<br/>Album Previews</a></li>
    <li><a href="./">Free Downloads</a></li>
    <li><a href="./">MTV Radio</a></li>
    <li><a href="./">Listen on Rhapsody</a></li>
    </ul>
    </li>
    <li><span class="dir">Genres</span>
    <ul>
    <li class="first"><a href="./">Rock</a></li>
    <li><a href="./">Pop</a></li>
    <li><a href="./">Hip-Hop</a></li>
    <li><a href="./">Soul/R&amp;B</a></li>
    <li><a href="./">Indie</a></li>
    </ul>
    </li>
    <li><a href="./">Billboard Charts</a></li>
    </ul>
    </li>
    <li id="n-shows"><a href="./" class="dir">Shows</a>
    <ul>
    <li class="first"><a href="./"><strong>TV Schedule</strong></a></li>
    <li><a href="./">MTV Shows Gossip</a></li>
    <li><a href="./">Show Photos</a></li>
    <li><a href="./">Be on MTV</a></li>
    <li><a href="./"
    target="_blank">Shop MTV Shows</a></li>
    </ul>
    </li>
    <li id="n-news"><a href="./" class="dir">News</a>
    <ul>
    <li class="first"><a href="./">News Main</a></li>
    <li><span class="dir">Headlines</span>
    <ul>
    <li class="first"><a href="./">Breaking News</a></li>
    <li><a href="./">Music News</a></li>
    <li><a href="./">Movie News</a></li>
    <li><a href="./">Video Game News</a></li>
    <li><a href="./">World/National News</a></li>
    </ul>
    </li>
    <li><a href="./">Video Updates &amp; Interviews</a></li>
    <li><a href="./">Newsroom Blog</a></li>
    <li><span class="dir">Live Music Coverage</span>
    <ul>
    <li class="first"><a href="./">Your Uploads</a></li>
    <li><a href="./">You R Here Blog</a></li>
    </ul>
    </li>
    <li><span class="dir">MTV Reporters</span>
    <ul>
    <li class="first"><a href="./">Liz Hernandez</a></li>
    <li><a href="./">Tim Kash</a></li>
    <li><a href="./">Kurt Loder</a></li>
    <li><a href="./">John Norris</a></li>
    <li><a href="./">SuChin Pak</a></li>
    <li><a href="./">Sway</a></li>
    </ul>
    </li>
    <li><a href="./">Video Games Blog</a></li>
    <li><a href="./">Street Team '08</a></li>
    <li><a href="./">Hottest MCs</a></li>
    <li><a href="./">News Alerts</a></li>
    </ul>
    </li>
    </ul>

    Selesai. Silakan temen2 ubah script diatas sesuai dengan kebutuhannya. Met Mencoba…


    Read More - Drop Down Menu Dengan CSS