Minggu, 14 Februari 2021

Materi CSS - Pertemuan 6 - CSS Backgrounds

CSS Backgrounds

The CSS background properties are used to define the background effects for elements.

In these chapters, you will learn about the following CSS background properties:

  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

CSS Backgrounds-color

The background-color property specifies the background color of an element.

Example

<!DOCTYPE html>
<html>
<head>
<style>
body {
  background-color: lightblue;
}
</style>
</head>
<body>

<h1>Hello World!</h1>

<p>This page has a light blue background color!</p>

</body>
</html>

With CSS, a color is most often specified by:

  • a valid color name - like "red"
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"

Look at CSS Color Values for a complete list of possible color values.

 

Other Elements

You can set the background color for any HTML elements:

Example

Here, the <h1>, <p>, and <div> elements will have different background colors: 

<!DOCTYPE html>
<html>
<head>
<style>
h1 {
  background-color: green;
}

div {
  background-color: lightblue;
}

p {
  background-color: yellow;
}
</style>
</head>
<body>

<h1>CSS background-color example!</h1>
<div>
This is a text inside a div element.
<p>This paragraph has its own background color.</p>
We are still in the div element.
</div>

</body>
</html>

 

Opacity / Transparency

The opacity property specifies the opacity/transparency of an element. It can take a value from 0.0 - 1.0. The lower value, the more transparent:

<!DOCTYPE html>
<html>
<head>
<style>
div {
  background-color: green;
}

div.first {
  opacity: 0.1;
}

div.second {
  opacity: 0.3;
}

div.third {
  opacity: 0.6;
}
</style>
</head>
<body>

<h1>Transparent Box</h1>
<p>When using the opacity property to add transparency to the background of an element, all of its child elements become transparent as well. This can make the text inside a fully transparent element hard to read:</p>

<div class="first">
  <h1>opacity 0.1</h1>
</div>

<div class="second">
  <h1>opacity 0.3</h1>
</div>

<div class="third">
  <h1>opacity 0.6</h1>
</div>

<div>
  <h1>opacity 1 (default)</h1>
</div>

</body>
</html>
 

Transparency using RGBA

If you do not want to apply opacity to child elements, like in our example above, use RGBA color values. The following example sets the opacity for the background color and not the text:

 

<!DOCTYPE html>
<html>
<head>
<style>
div {
  background: rgb(0, 128, 0);
}

div.first {
  background: rgba(0, 128, 0, 0.1);
}

div.second {
  background: rgba(0, 128, 0, 0.3);
}

div.third {
  background: rgba(0, 128, 0, 0.6);
}
</style>
</head>
<body>

<h1>Transparent Box</h1>
<p>With opacity:</p>

<div style="opacity:0.1;">
  <h1>10% opacity</h1>
</div>

<div style="opacity:0.3;">
  <h1>30% opacity</h1>
</div>

<div style="opacity:0.6;">
  <h1>60% opacity</h1>
</div>

<div>
  <h1>opacity 1</h1>
</div>

<p>With RGBA color values:</p>
<div class="first">
  <h1>10% opacity</h1>
</div>

<div class="second">
  <h1>30% opacity</h1>
</div>

<div class="third">
  <h1>60% opacity</h1>
</div>

<div>
  <h1>default</h1>
</div>

<p>Notice how the text gets transparent as well as the background color when using the opacity property.</p>

</body>
</html>
 

CSS background-image

The background-image property specifies an image to use as the background of an element.

By default, the image is repeated so it covers the entire element.

<!DOCTYPE html>
<html>
<head>
<style>
body {
  background-image: url("paper.gif");
}
</style>
</head>
<body>

<h1>Hello World!</h1>

<p>This page has an image as the background!</p>

</body>
</html>

 

The background image can also be set for specific elements, like the <p> element:

<!DOCTYPE html>
<html>
<head>
<style>
p {
  background-image: url("paper.gif");
}
</style>
</head>
<body>

<h1>Hello World!</h1>

<p>This paragraph has an image as the background!</p>

</body>
</html>
 

 

 

 

 

 

 

Desain Grafis 2 - Pertemuan 6 - Bentuk

 Bentuk 

Bentuk disebut juga shape, dihasilkan dari garis-garis yang tersusun sedemikian rupa. bentuk ada yang berbentuk 2 dimensi (dwimatra) dan 3 dimensi (trimatra).

Setiap bentuk mempunyai arti tersendiri, tergantung budaya, geografis dll. Contoh : Segitiga bisa melambangkan konsep trinitas (ayah, ibu, anak) tapi di mesir bisa melambangkan simbol feminimitas (kewanitaan).

Bentuk dasar 2 dimensi dan variasinya 

pada dasarnya, bentuk dimulai dari segi 3 sampai segi tidak terhingga atau lingkaran. Dari bentuk dasar tersebut bisa dibuat pengembangan / kombinasi dan variasi yang lebih banyak lagi.



 

   


Kombinasi dari bentuk-bentuk dasar akan menghasilkan bentuk baru. Kemampuan untuk mengkombinasikan bentuk dapat dijumpai di CorelDraw yaitu Shaping (menu > Arrange > Shaping).

Contoh kombinasi bentuk :

Intersection 

 



 

 





Senin, 01 Februari 2021

Desain Grafis 2 - Pertemuan 4 - Kombinasi Garis

 1. B Kombinasi Garis 

Kombinasi garis Horizontal dan vertikal

Memberi kesan : Formal, kokoh, tegas

Kombinasi garis diagonal

Memberi kesan : konflik, perang, benci, larangan, contoh : rambu lalu lintas

 


Kombinasi garis Kurva 

Spiral : memberi kesan : kelahiran atau generasi penerus, hipnotis

Setengah lingkaran : memberi kesan kekokohan 

Gelombang : memberi kesan : mengalir, lembut, gemulai

 


 Kombinasi pada sudut 

Ini contoh sudut yang biasa digunakan desainer grafis. Pembuatan sudut tumpul tersedia di software CorelDraw atau Autocad.

 


 

Pengulangan 

Pengulangan akan menimbulkan irama. Sehingga kesannya bisa riang, tenang, malas, stabil. Zig zag memberi kesan bergairah, semangat, dinamika atau gerak cepat.

 


Pencerminan

Dengan pencerminan seakan tercipta bentuk baru yang tidak terbayang sebelumnya. Kesan yang ditimbulkan dari pencerminan : Formal & sederhana.

 


  

 Pancaran 

Memberi kesan : Adanya jarak, Kejauhan, Fokus, Meledak, Spontanitas, Memusat, Keleluasaan, tanpa batas dll.

 


 

Minggu, 31 Januari 2021

Materi CSS - Pertemuan 4 - CSS Comments & Colors

 

CSS Comments

Comments are used to explain the code, and may help when you edit the source code at a later date.

Comments are ignored by browsers.

A CSS comment is placed inside the <style> element, and starts with /* and ends with */:

 Example

/* This is a single-line comment */
p {
  color: red;
}
  
 
You can add comments wherever you want in the code:

Example

 

p {
  color: red;  /* Set text color to red */
}

 

Comments can also span multiple lines: 

 

Example

 

/* This is
a multi-line
comment */


p {
  color: red;
}

 

HTML and CSS Comments

In the following example, we use a combination of HTML and CSS comments:

<!DOCTYPE html>
<html>
<head>
<style>
p {
  color: red; /* Set text color to red */
}
</style>
</head>
<body>

<h2>My Heading</h2>

<!-- These paragraphs will be red -->
<p>Hello World!</p>
<p>This paragraph is styled with CSS.</p>
<p>CSS comments are not shown in the output.</p>

</body>
</html>

 

CSS Colors

Colors are specified using predefined color names, or RGB, HEX, HSL, RGBA, HSLA values.

CSS Color Names

In CSS, a color can be specified by using a predefined color name:

<!DOCTYPE html>
<html>
<body>

<h1 style="background-color:Tomato;">Tomato</h1>
<h1 style="background-color:Orange;">Orange</h1>
<h1 style="background-color:DodgerBlue;">DodgerBlue</h1>
<h1 style="background-color:MediumSeaGreen;">MediumSeaGreen</h1>
<h1 style="background-color:Gray;">Gray</h1>
<h1 style="background-color:SlateBlue;">SlateBlue</h1>
<h1 style="background-color:Violet;">Violet</h1>
<h1 style="background-color:LightGray;">LightGray</h1>

</body>
</html>

 

CSS Background Color

You can set the background color for HTML elements:

<!DOCTYPE html>
<html>
<body>

<h1 style="background-color:DodgerBlue;">Hello World</h1>

<p style="background-color:Tomato;">
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.
</p>

</body>
</html>

 

CSS Text Color

You can set the color of text:

<!DOCTYPE html>
<html>
<body>

<h3 style="color:Tomato;">Hello World</h3>

<p style="color:DodgerBlue;">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>

<p style="color:MediumSeaGreen;">Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.</p>

</body>
</html>
 

 

CSS Border Color

You can set the color of borders:

<!DOCTYPE html>
<html>
<body>

<h1 style="border: 2px solid Tomato;">Hello World</h1>

<h1 style="border: 2px solid DodgerBlue;">Hello World</h1>

<h1 style="border: 2px solid Violet;">Hello World</h1>

</body>
</html>
 

 

CSS Color Values

In CSS, colors can also be specified using RGB values, HEX values, HSL values, RGBA values, and HSLA values:

Same as color name "Tomato":

<!DOCTYPE html>
<html>
<body>

<p>Same as color name "Tomato":</p>

<h1 style="background-color:rgb(255, 99, 71);">rgb(255, 99, 71)</h1>
<h1 style="background-color:#ff6347;">#ff6347</h1>
<h1 style="background-color:hsl(9, 100%, 64%);">hsl(9, 100%, 64%)</h1>

<p>Same as color name "Tomato", but 50% transparent:</p>
<h1 style="background-color:rgba(255, 99, 71, 0.5);">rgba(255, 99, 71, 0.5)</h1>
<h1 style="background-color:hsla(9, 100%, 64%, 0.5);">hsla(9, 100%, 64%, 0.5)</h1>

<p>In addition to the predefined color names, colors can be specified using RGB, HEX, HSL, or even transparent colors using RGBA or HSLA color values.</p>

</body>
</html>

 

 

 

 

 

 

 

 

 

 

 

 

Minggu, 24 Januari 2021

Materi CSS - Pertemuan 3 - How To Add CSS

 

Three Ways to Insert CSS

 

There are three ways of inserting a style sheet:

 

1. External CSS

2. Internal CSS

3. Inline CSS

 

External CSS

 

With an external style sheet, you can change the look of an entire website by changing just one file!

Each HTML page must include a reference to the external style sheet file inside the <link> element, inside the head section.

 

Example

 

External styles are defined within the <link> element, inside the <head> section of an HTML page:

 

<!DOCTYPE html>
<html>
<head>
<link
rel="stylesheet" href="mystyle.css">
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html> 

 

An external style sheet can be written in any text editor, and must be saved with a .css extension.

 

The external .css file should not contain any HTML tags.

Here is how the "mystyle.css" file looks:

 

"mystyle.css"

 

body {
  background-color:
lightblue;
}

h1 {
  color: navy;
  margin-left: 20px;
}

 

Note: Do not add a space between the property value and the unit (such as margin-left: 20 px;). The correct way is: margin-left: 20px;

 

Internal CSS

 

An internal style sheet may be used if one single HTML page has a unique style.

 

The internal style is defined inside the <style> element, inside the head section.

 

Example

 

Internal styles are defined within the <style> element, inside the <head> section of an HTML page:

 

<!DOCTYPE html>
<html>
<head>
<style>
body {
  background-color: linen;
}

h1 {
  color: maroon;
  margin-left: 40px;
}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html> 

 

Inline CSS

 

An inline style may be used to apply a unique style for a single element.

 

To use inline styles, add the style attribute to the relevant element. The style attribute can contain any CSS property.

 

Example

 

Inline styles are defined within the "style" attribute of the relevant element:

 

<!DOCTYPE html>
<html>
<body>

<h1 style="
color:blue;text-align:center;">This is a heading</h1>
<p style="
color:red;">This is a paragraph.</p>

</body>
</html> 

 

Tip: An inline style loses many of the advantages of a style sheet (by mixing content with presentation). Use this method sparingly.

 

 

Multiple Style Sheets

 

If some properties have been defined for the same selector (element) in different style sheets, the value from the last read style sheet will be used. 

 

Assume that an external style sheet has the following style for the <h1> element:

 

h1 {
  
color: navy;
}

 

Then, assume that an internal style sheet also has the following style for the <h1> element:

 

h1 {
  
color: orange;   
}

 

Example

 

If the internal style is defined after the link to the external style sheet, the <h1> elements will be "orange":

 

<head>
<link
rel="stylesheet" type="text/css" href="mystyle.css">
<style>
h1 {
  
color: orange;
}
</style>
</head>

 

Example

 

However, if the internal style is defined before the link to the external style sheet, the <h1> elements will be "navy": 

 

<head>
<style>
h1 {
  
color: orange;
}
</style>
<link
rel="stylesheet" type="text/css" href="mystyle.css">
</head>

Desain Grafis 2 - Pertemuan 3 - Komponen Desain Grafis

 

Pendahuluan

 

Jika anda tertarik dengan seseorang, bisa karena penampilan fisiknya, misal : rambut panjang, pakaian rapi, badan yang ramping, tegap, kulit mulus dll. Atau bisa faktor non fisik misal : ucapan yang lembut, perhatiannya, sikap yang rendah hati, imannya dll.

 

Begitu pula dengan desain grafis. Sebuah karya bisa diatakan menarik karena faktor fisik misal : warna, jenis huruf, ilustrasi, ukuran atau tata letaknya. Atau karena faktor non fisik, misal : pesan moral yang disampaikan, idenya yang kreatif, kesesuaian dengan target audience dll.

 

Oleh karena itu cara pandang karya grafis bisa dipandang dari dua sudut yaitu fisik dengan indera mata dan non fisik dengan hati.

 

Pada penjelasan kali ini akan membahas desain secara fisik khususnya mata agar bisa menarik (eye catching). Untuk itu diperlukan pengetahuan tentang komponen dalam desain grafis, antara lain :

 

1. Garis  
2. Bentuk (Shape)  
3. Warna, Tekstur dan Cahaya 
4. Ilustrasi / Gambar
5. Teks / Tipografis        
6. Ruang (Space)
 
 

Jika dianalogikan dengan makanan, komponen tersebut bisa dianggap sebagai bahan & bumbu masak. Tidak semua bahan dan bumbu yang ada di dapur dimasukkan sekaligus. Jika semua bumbu dicampurkan, bagi yang memakannya bisa mual dan muntah, bukan? Begitu pula dengan desain grafis, tidak semua karya desain menampung semua komponen tersebut. Mungkin hanya satu atau beberapa unsur yang diprioritaskan. Jika semua komponen tersebut tampil sama kuatnya bisa-bisa audience pusing melihat karya anda.

 

Bahan dan bumbu tersebut sebelum dimasak, harus dipotong, dibersihkan dan diolah terlebih dahulu. Koki dengan ilmu memasaknya, akan membuat makanan yang lezat dengan mengikuti resep dan komposisi, waktu dan suhu tertentu, begitu pula desain grafis, agar desain menarik, komponen grafis tersebut harus diedit, retouching, diberi efek dll. Kemudian dikomposisikan / layout dengan Prinsip Desain antara lain :

 
1.Keseimbangan (Balance)
2.Irama / Urutan (Sequence / Rythm)
3.Penekanan (Emphasis / Focus)
4.Kesatuan (Unity)       
 
 

Sama seperti komponen grafis, karya desain grafis kita tidak selalu menampung prinsip tersebut sama kuatnya. Anda harus memberi skala prioritas dan kompromi terhadap prinsip-prinsip tersebut. Berikut adalah contoh prioritas dan kompromi dalam desain grafis : 

 

 
 
 
 
 

 

Untuk lebih jauh lagi, kita akan bahas tentang sifat dan aplikasi komponen desain grafis satu persatu :

 

1.Garis

 

Dalam kenyataannya ‘garis’ itu tidaklah ada. Jika anda kira rambut itu adalah garis, coba lihat dengan mikroskop, rambut terlihat dan terdiri dari banyak sel dan bentuk – bentuk organik. Garis tercipta dari adanya perbedaan warna, cahaya atau jarak.

 

Tetapi dalam desain grafis, garis didefinisikan sebagai sekumpulan titik yang dideretkan memanjang. Seperti halnya pada gambar Bitmap. Atau bisa dikatakan garis adalah penghubung antara dua titik yang berbeda koordinat. Hal ini digunakan pada aplikasi vector seperti CorelDraw atau Illustrator.

 

Setiap jenis garis memiliki karakter dan suasana yang berbeda. Setiap garis menimbulkan kesan psikologis / persepsi tersendiri. Misal garis yang membentuk ‘S’, sering dirasakan sesuatu yang lembut, halus dan gemulai. Bandingkan dengan garis yang membentuk ‘Z’, terkesan tegas dan kaku. Perasaan ini terjadi karena ingatan kita menyamakan bentuk lengkung seperti bentuk tubuh atau ombak di laut.  

   

 

1.A Jenis Garis

 

Orientasi 

 

Garis secara arah / orientasi, garis terdiri dari :


1.Garis Lurus Horisontal, memberi kesan : ketenangan atau hal yang tak bergerak
2.Garis lurus Vertikal, memberi kesan : stabilitas, kekuatan atau kemegahan
3.Garis lurus Miring Diagonal, memberi kesan : tidak stabil, sesuatu yang bergerak atau dinamika
4.Garis melengkung (Kurva) memberi kesan : keanggunan, halus 

 

Garis mempunyai style/ gaya,  contohnya sebagai berikut :

 


 

1.Garis Continuous berkesan : kaku, keras, tajam dan konsisten
2.Garis putus-putus (dots & dash) berkesan : ragu, misterius, takut, berirama