>Halo semuanya,
>
>Mohon bantuannya. Saya bingung apa bedanya CLASS dengan ID di CSS dan kapan
>pakai CLASS dan kapan pakai ID?


dari Netscape DynHTML , bisa didownload di Netscape DevEdge ..
------------------------------------------------------

CLASS
The CLASSES JavaScript property allows you to define classes of styles in a
style sheet. The CLASS attribute specifies a style class to apply to an
element.

Although CSS syntax and JavaScript syntax use slightly different syntax to
define classes of styles, the use of the CLASS attribute is the same in both
syntaxes. For example:

CSS Syntax Example
<STYLE TYPE="text/css">
  H3.class1 {font-style:italic; color:red;}
</STYLE>
JavaScript Syntax Example
<STYLE TYPE="text/javascript">
classes.class1.H3.fontStyle="italic";
classes.class1.H3.color="red";
</STYLE>
Style Sheet Use
<H3 CLASS="class1">This H3 is in red italic letters.</H3>
Class names are case-sensitive.

*Each HTML element can use only one style class.*

To specify that a class can apply to all elements, use the element selector
all when you set the properties for the class. For example, the code sample
below specifies that the class LEMON can be applied to any element, and all
elements that use the style class LEMON are yellow.

CSS Syntax
<STYLE TYPE="text/css">
  all.LEMON {color:yellow;}
</STYLE>
JavaScript Syntax
<STYLE TYPE="text/javascript">
  classes.LEMON.all.color="yellow";
</STYLE>
Style Sheet Use
<H1 class="LEMON">A Nice Yellow Heading</P>
<P CLASS="LEMON">What a nice shade of yellow this paragraph is.</P>

-----------------------
ID
When defining style sheets, you can create individual named styles.

An element can use a style class and also use a named style. This allows you
to use named styles to express individual stylistic exceptions to a style
class.

To define an individual names style in CSS syntax, you use the # sign to
indicate a name for an individual style, while In JavaScript syntax, you use
the ID selector.

In both CSS syntax and JavaScript syntax, you use the ID attribute in an
HTML element to specify the style for that element.

ID names are case-sensitive.

*ID styles are particularly useful for working with layers of precisely
positioned HTML content, as discussed in Part 2. Positioning HTML Content.*

The following code shows an example of the use of individual named styles.
In this example, the STYLE1 class defines a style with several
characteristics. The named style A1 specifies that the color is blue. This
style can be used to specify that a paragraph has all the style
characteristics of STYLE1, except that its color is blue instead of red.

CSS Syntax
<STYLE TYPE="text/css">
  P.STYLE1 {
  color:red; font-size:24pt; line-height:26pt;
  font-style:italic; font-weight:bold;
  }
  #A1 {color: blue;}
</STYLE>
JavaScript Syntax
<STYLE TYPE="text/javascript">
  with (classes.STYLE1.P) {
    color="red";
    fontSize="24pt";
    lineHeight="26pt";
    fontStyle="italic";
    fontWeight="bold";
  }
  ids.A1.color= "blue";
</STYLE>
Style Sheet Use
<P CLASS="STYLE1">Big red text</P>
<P CLASS="STYLE1" ID="A1">Big blue text</P>

Sorry , lagi males nerjemahin dan ngrangkum ... :)moga2 nyampe messagenya
dan membantu ..

-----------------------------------
btw, permisi numpang lewat .. di http://www.toekangweb.or.id
ada artikel baru (diupload :) judulnya " Have No Fear of Beauty "
ama " Dasar Design Grafis " ... silakan dicek ..
-----------------------------------

Doni Yudono, Editor
[ http://www.toekangweb.or.id ]
Pengamat Web Design


-= Dual T3 Webhosting on Dual Pentium III 450 - www.indoglobal.com =-
To unsubscribe, e-mail : [EMAIL PROTECTED]
To subscribe, e-mail   : [EMAIL PROTECTED]
Netika BerInternet     : [EMAIL PROTECTED]

Kirim email ke