Rabu, 26 November 2008

Dasar CSS

CSS singkatan dari Cascading Style Sheet, merupakan kode untuk mengatur tampilan halaman. Untuk mengatur jenis huruf, warna, ketebalan, bisa langusng menggunakan TAG HTML, namun dalam perkembangannya menjadi rumit kalau menyangkut desain yang banyak, kalau mau mengedit, maka tiap halaman harus di edit satu-satu.

Dengan CSS kita tinggal masuk ke script CSS nya lalu mengganti bagian mana yang akan diganti. Karena dalam CSS semua sudah dikelompokkan dalam ID atau Class tertentu, maka menjadi mudah manajemen halamnnnya.


CSS ada yang merupakan file terpisah, CSS external, yang kemudian di link ke halaman HTML. Satu file CSS bisa dipakai untuk banyak halaman dengan style sama. Pemisahan halaman HTML dengan CSS akan memudahkan dalam pengeditan. Namun hal ini membutuhkan hosting untuk menyimpan file. Keuntungan lainnya, dengan memisahkan file css, tak mudah ditiru orang hanya dengan melihat source codenya. Untuk untuk membuat CSS external, buatlah file dengan extensi *.css.


Misalnya: File: latihan1.css


body

{


bground-color:#red

}


kemudian buat file html, misalnya dengan nama latihan1.html

cara menyisipkan kode CSS yaitu dengan koneksi link css:


Sisipkan diantara tag <head>...</head> kode sebagai berikut:


<style type=text/css>

<link href="latihan1.css" rel="stylesheet" type="text/css">

</style>


Ada juga CSS yang menjadi bagian dari halaman, CSS internal, seperti dalam halaman Blogger saya. Kelebihannya, tak membutuhkan hosting kkhusus untuk menyimpan file css nya. Ini merupakan solusi untuk blog seperti Bloger, wordpress yang hanya menyediakan halaman jadi, tidak menyediakan hosting file.


Cara membuat CSS internal.

Letak script CSS berada pada tag <head>...</head>

Diawali dengan


<style type =”text/css”>

<--

di sini script CSS

-->

</style>>


Tag CSS: selector {properties:value;}

Contoh:


body {

bground-color:#ffffff;

}


akan menghasilkan latar belakang putih.


img

{

border:1px solid

}


akan menghasilkan, setiap tag <img> yang tidak ditentukan class nya, akan diberi border sebesar 1 px.


Kalau ditentukan kelasnya misalnya:


.display img

{

border:0;

}


gambar yang dimasukkanke class .display tidak ada garisnya.


Class selector

Dalam CSS tiap-tiap bagian bisa dibagi-bagi dalam class yang berbeda sehingga memudahkan dalam pengeditan. Misalnya kita akan membedakan jenis huruf, ukuran, warha untuk tanggal, judul tulisan, dan isi tulisan. Kita buat tiga class dengan nama “tanggal”, “judul”, “isi”


.tanggal

{

font-family:verdana, arial, Helvetica;

font-size:10 px;

color:#green;

}


penggunaanya:


<div class=”tanggal”>

12 Juni 2007

</div>


menghasilkan: 12 Juni 27, font verdana, ukuran font 10px, warna hijau.


.judul

{

font-family:verdana, arial, Helvetica;

font-size:12 px;

color:#red;

text-transform:uppercase;

}


tampilan: font verdana, ukuran font 12px, warna: merah, huruf besar semua (uppercase).


.isi

{

font-family:Georgia, “times new roman”, arial;

font-size:12 px;

color:#000000;

}


tampilan: font Georgia (cirikhas wordpress, juga template minima-nya blogger), ukuran font 12px, warna hitam.


.kolomisi

{

padding:10px 5px 10px 10px;

}


artinya:

kalau kolom <td> diberi style .kolomisi akan terformat dengan Padding atas:10px, padding kanan:5px, padding bawah: 10px, dan padding kiri: 10px.

Selengkapnya...

Senin, 24 November 2008

Conformance

2.1. Definitions

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 (see [RFC2119]). However, for readability, these words do not typically appear in all uppercase letters in this specification.

Additional key words, e.g. "User agent (UA)", are defined by CSS 2.1 ( [CSS21], section 3.1).



2.2. Classes of products

The following classes of products (many of which overlap) should consider implementing this specification:

● Web browsers

● User agents that implement one or more of the following types of content: HTML (e.g. [HTML401]), XHTML (e.g. [XHTML10], [XHTML11]), XForms (e.g. [XFORMS10]), SVG (e.g. [SVG10], [SVG11]) or other content languages that contain forms controls or are intended for user interaction
● User agents that implement one or more levels, modules and or profiles of CSS (e.g. [CSS1], [CSS21])



2.4. Profiles

This specification contains a number of informative profiles. These profiles are not mandatory for conformance.



2.4. Extensions

This specification does not define any explicit extension mechanisms. If an implementation needs to extend the functionality of this specification, it must follow any/all guidelines and requirements of extensions as defined in CSS2.1, e.g. Vendor-specific extensions ( [CSS21], section 4.1.2).
Selengkapnya...

Introduction

This section is normative.

CSS3 is a set of modules, divided up and profiled in order to simplify the specification, and to allow implementors the flexibility of supporting the particular modules appropriate for their implementations.

This module describes selectors and CSS properties which enable authors to style user interface related states, element fragments, properties and values.

Section 2.1 of CSS1 [CSS1] and Chapter 18 of CSS2 [CSS2] introduced several user interface related pseudo- classes, properties and values. Section 6.6.4 of Selectors HYPERLINK \l "page1" [SELECT] also describes several additional user interface related pseudo-classes (and one pseudo-element).

This Working Draft extends them to provide the ability, through CSS, to style elements based upon additional user interface states, to style fragments of user interface elements, and to alter the dynamic presentation of elements in ways previously only available through specific HTML4/XHTML1 elements and attributes.



1.1. Purpose

The purpose of this specification is to achieve the following objectives:

● Extend the user interface features in CSS2.1.

● Provide additional CSS mechanisms to simulate the appearance of various standard form elements.

● Provide additional CSS mechanisms to augment or replace other dynamic presentation related features in HTML4/XHTML1.

● Introduce directional navigation properties to assist in the construction of user interfaces which make use of a directional navigation model.

● Introduce properties and values to specify icon presentations for elements to enhance accessibility


1.2. Scope

This proposal specifies how to alter the look and feel of various elements, and specifically does not address the meaning behind what a specific look and feel may imply. For example, with the additions in the proposal, an author can make any element look and even feel like a submit button. Yet, that arbitrary element is not afforded any additional meaning, so pushing it does nothing by default, and certainly does not submit a form.

Similarly, the HTML4 ) could be styled to appear as a group of radio-buttons, and yet, since those elements are still semantic checkboxes, they can still be individually checked or unchecked, rather than acquiring any kind of radio-button group semantic where only one can be checked.

Each example of presentation has a different look and feel, but maintains its original meaning, a choice (or choices) among several alternatives. This proposal addresses only the former (look and feel), not the latter (meaning).

Since this proposal serves to simulate the appearance of various user interface and forms elements in HTML4/XHTML, it is perhaps useful to call out what specifically is believed to be outside the scope of CSS, or better suited to document structure rather than style and therefore not addressed by this proposal:

● Form semantics, including, but not limited to, submission, resetting, naming, what determines a successful or valid form control, and how to process form data.

● Form contents, including, but not limited to initial value, current value, and form content types. The HTML4 'maxlength' attribute, for example, determines the maximum number of characters the user can enter into an or field, and as such is a content constraint rather than a presentational suggestion.

● Form control dependencies, including, but not limited to, whether only one option from a set of choices may be chosen, or whether multiple options may be chosen.
● The HTML4/XHTML1

element and its unique attributes ('action', 'method', 'enctype', 'acce

'accept-charset').

In addition, this document does not attempt to solve all user interface related issues / features that can be found in modern user interfaces. Perhaps future versions may attempt to solve these. For example:

● Complex or composite controls (e.g. the HTML4 and the elements).

● The appearance, styling and coloring of scrollbars.

● Window layering. There is no attempt made to distinguish the appearance of elements in the front-most window versus non-front-most windows. The semantics of window layering must be addressed before it is appropriate to attempt to style such concepts.

● Palettes and floating windows. Along with the concept of "frontmost" window, windows that float but do not receive focus are also not addressed.

● Browser window chrome and toolbars.

● The default styling of the HTML4/XHTML1
, , <'frame> and <'frameset> elements.

● Frame-resizing behavior. The behavior of <'frame> and <'frameset>, specifically the ability to "share" resizability when elements share a border, perhaps by leveraging the border-collapse property is also not addressed.



Selengkapnya...

Followers

Tutorial css, web design © 2008 Template by Dicas Blogger.

TOPO