CSS Internal


.

Inline CSS - Sebuah atribut HTML

Believe it or not, CSS is built in to every HTML tag. Percaya atau tidak, CSS dibangun di setiap tag HTML. If you want to add a style inside an HTML element all you have to do is specify the desired CSS properties with the style HTML attribute. Jika Anda ingin menambahkan gaya dalam elemen HTML yang harus Anda lakukan adalah menentukan properti CSS yang diinginkan dengan atribut HTML gaya. Let's add some style to a paragraph tag. Mari kita menambah gaya beberapa tag paragraf.

CSS Code: CSS Code:

<p style="background: blue; color: white;">A new background and <p style="background: blue; color: white;"> Latar belakang baru dan
 font color with inline CSS</p> warna font dengan CSS inline </ p>

Display: Tampilan:

A new background and font color with inline CSS Latar belakang baru dan warna font dengan inline CSS
If you have read through the beginning of this CSS tutorial, you probably have a good idea of what is going on. Jika Anda telah membaca awal tutorial CSS ini, Anda mungkin memiliki gagasan yang bagus dari apa yang terjadi. Below is the general form for setting inline CSS in any HTML element. Berikut ini adalah bentuk umum untuk menetapkan inline CSS dalam setiap elemen HTML.

Pseudo Code: Pseudo Code:

<htmltag style="cssproperty1: value; cssproperty2: value;"> </htmltag> <htmltag style="cssproperty1: value; cssproperty2: value;"> </ htmltag>
The normal rules of CSS apply inside the style attribute. Aturan normal CSS berlaku di dalam atribut style. Each CSS statement must be separated with a semicolon ";" and colons appear between the CSS property and its value. Setiap pernyataan CSS harus dipisahkan dengan tanda titik koma ";" dan titik dua muncul antara properti CSS dan nilainya.

Common Inline CSS Mistakes Kesalahan Umum Inline CSS

When using CSS inline you must be sure not to use quotations within your inline CSS. Ketika menggunakan CSS inline Anda harus yakin untuk tidak menggunakan kutipan dalam inline CSS. If you use quotations the browser will interpret this as the end of your style value. Jika Anda menggunakan kutipan browser akan menafsirkan ini sebagai akhir nilai gaya Anda. Instead, copy our form as we have displayed below. Sebaliknya, salinan formulir kami seperti yang telah kita ditampilkan di bawah.

CSS Code: CSS Code:

<p style="background: url("yellow_rock.gif");"> <p style="background: url("yellow_rock.gif");"> 
 This is broken</p> Ini rusak </ p> 

 <p style="background: url(yellow_rock.gif);"> <p style="background: url(yellow_rock.gif);"> 
 This is workin'</p> Ini workin '</ p> 

Display: Tampilan:

This is broken Ini rusak
This is workin' Ini workin '

Your Reply