CSS adalah singkatan dari Cascading Style Sheets. Fungsi utama CSS adalah untuk mengatur tag-tag pada dokumen HTML dengan mudah. CSS hanya mengatur tampilan tag pada dokumen HTML, sedangkan fungsi tag tidak bisa diganti dengan menggunakan CSS. Dengan menggunakan CSS kita bisa mengatur warna, jenis huruf, ukuran huruf, spasi di antara tag, posisi tag pada layar, latar belakang warna, latar belakang gambar dan lain sebagainya. CSS juga dapat digunakan untuk menyesuaikan tampilan tag apabila ditampilkan pada layar dengan ukuran yang berbeda-beda, atau lebih dikenal dengan istilah tampilan responsive.
Pada dasarnya pengerjaan CSS bukanlah tugas seorang programmer tapi adalah tugas seorang design web tapi seorang programmer juga sebaiknya tahu konsep CSS. Terdapat banyak jasa design web yang ada di internet, seperti contoh jasa desain website profesional di sribu.
Tutorial ini tidak akan membahas semua fungsi CSS, tapi hanya konsep dan fungsi-fungsi dasarnya saja.
Pengertian CSS dan Cara Kerjanya
Ada tiga cara membuat CSS di dalam dokumen HTML :
- Secara inline, dengan menggunakan atribut style pada setiap tag pada dokumen HTML
- Internal, dengan memakai tag style di dalam bagian tag head dokumen HTML
- External, dengan memakai link URL kepada file dengan ekstensi .css
Css Inline #
CSS inline dapat dibuat untuk setiap tag dengan menggunakan atribut style. Setiap tag akan mempunyai style sendiri-sendiri.
<h1 style="color:blue;">A Blue Heading</h1>
<p style="color:red;">A red paragraph.</p>
Cara inline tidak begitu efektif untuk mengatur banyak tag karena atribut style harus ditulis satu persatu untuk semua tag di dalam dokumen HTML. Cara inline dipakai apabila ingin membuat CSS khusus untuk tag tertentu.
CSS Internal #
CSS internal dapat dibuat di dalam tag head pada dokumen HTML. Dengan CSS internal dimungkinkan untuk membuat CSS pada beberapa tag sekaligus di dalam dokumen HTML.
<!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1 {color: blue;}
p {color: red;}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
<h1>This is another heading</h1>
<p>This is another paragraf.</p>
</body>
</html>
CSS internal dapat mengatur CSS untuk setiap tipe tag. Seperti ditunjukkan pada contoh di atas, semua tag h1 akan berwarna biru dan semua tag p akan berwarna merah.
CSS Eksternal #
CSS eksternal dibuat dengan menyertakan link URL file berektensi .css di dalam dokumen HTML. CSS eksternal semakin efektif karena memungkinkan untuk mengatur semua tag pada beberapa file html yang berbeda-beda.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Dokumen HTML pada contoh di atas memperlihatkan link URL kepada file styles.css. Isi file styles.css sendiri dapat dilihat pada contoh di bawah ini.
body {
background-color: powderblue;
}
h1 {
color: blue;
}
p {
color: red;
}
Link URL kepada styles.css dapat dipakai di dalam dokumen HTML lain. CSS eksternal lebih banyak dipakai untuk pengembangan aplikasi web. Tim design bertanggung jawab untuk membuat file styles.css. Tim web developer bisa memakai file styles.css tersebut di dalam setiap dokumen HTML yang mereka buat.
Beberapa Fungsi Dasar CSS #
CSS mempunyai banyak fungsi untuk mengatur tampilan tag dalam dokumen HTML. Fungsi ini didefinisikan melalui properti CSS.
Mengatur Warna, Jenis dan Ukuran Huruf #
Properti color digunakan untuk mengatur warna huruf suatu tag. Properti font-family digunakan untuk mengatur jenis huruf suatu tag. Properti font-size digunakan untuk mengatur ukuran huruf pada suatu tag.
<!DOCTYPE html>
<html>
<head>
<style>
h1 {
color: blue;
font-family: verdana;
font-size: 300%;
}
p {
color: red;
font-family: courier;
font-size: 160%;
}
</style>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Mengatur Border #
Properti border dapat digunakan untuk mengatur border tag.
p {
border: 2px solid powderblue;
}
Pada contoh di atas border semua tag p menjadi 2 pixel.
Mengatur Padding #
Properti padding digunakan untuk mengatur jarak antara text atau tag dengan border tag tersebut.
p {
border: 2px solid powderblue;
padding: 30px;
}
Mengatur Margin #
Properti margin digunakan untuk mengatur jarak antara border suatu tag dengan tag lain.
p {
border: 2px solid powderblue;
margin: 50px;
}
Our Mission
Provide quality Japanese Language Training for the students and working professionals
Provide Technical Training along with live project experience in IT Software Development, Web Development
Provide Outsourcing IT services worldwide
For More Details: https://nozomiinternational.com/
Hi there,
We run an Instagram growth service, which increases your number of followers safely and practically.
We aim to gain you 300-1000+ real human followers per month, with all actions safe as they are made manually (no bots).
The price is just $60 (USD) per month, and we can start immediately.
Let me know if you are interested and have any questions.
Kind Regards,
Libby
Hi,
I intend to contribute a guest post to your website that will help you get good traffic as well as interest your readers.
Shall I send you the topics then?
Best,
Alvina Miller
Hi there,
We run an Instagram growth service, which increases your number of followers safely and practically.
We aim to gain you 300-1000+ real human followers per month, with all actions safe as they are made manually (no bots).
The price is just $60 (USD) per month, and we can start immediately.
Let me know if you wish to see some of our previous work.
Kind Regards,
Megan
Today we launch our Black Friday discounts. We significantly reduced our prices on all of our applications.
Access competitive prices on applications for your website such as: SEO, video, email marketing, saas applications, productivity, social media and more.
Get the discounts here:
https://bit.ly/BlackFridayHotAppsDiscounts
Hello, I’m reaching out about the laptop I purchased from your store on Amazon (model here: https://amzn.to/46pmr71). It’s not working, and I was told to contact you for any support or return queries. This purchase was meant to be a special gift. I need a quick response or I’ll be forced to consider a chargeback. Regards, Steve
Hi there,
We run an Instagram growth service, which increases your number of followers both safely and practically.
– We guarantee to gain you 300-1000+ followers per month.
– People follow you because they are interested in you, increasing likes, comments and interaction.
– All actions are made manually by our team. We do not use any ‘bots’.
The price is just $60 (USD) per month, and we can start immediately.
If you’d like to see some of our previous work, let me know, and we can discuss it further.
Kind Regards,
Megan
Hello, I’m reaching out about the laptop I purchased from your store on Amazon (model here: https://amzn.to/46pmr71). It’s not working, and I was told to contact you for any support or return queries. This purchase was meant to be a special gift. I need a quick response or I’ll be forced to consider a chargeback. Regards, Steve
How to use AI to optimize nextgen.co.id marketing campaigns and get more out of your marketing budget.
In today’s competitive business landscape, it’s more important than ever to make sure that your marketing efforts are delivering results. But with so many different channels and tactics available, it can be difficult to know where to start. That’s where AI comes in.
AI-powered marketing measurement tools can help you to:
– Allocate your marketing budget more effectively
– Identify and eliminate wasted ad spend
– Track the impact of your marketing campaigns
– Make data-driven decisions to improve your results
It also includes a case study about how one company like yours, nextgen.co.id, can use AI-powered marketing measurement platform, to increase their ROI by 35%.
Get access visiting the link below
https://bit.ly/howtoimprovecustomerretention
I have 100% fully verified website contact forms for sale. Do your own blasts – save money!
Quantity Price
=====================
500,000 $50
1 Million $99
5 Million $199
10 Million $299
20 Million $499
Credit card payment accepted, download links provided same day of purchase. Get in touch with me at my email/skype below for more info or if you would like to order.
P. Stewart
Skype: live:.cid.e169e59bb6e6d159
Email: ps8498@gomail2.xyz
Hi there,
We run an Instagram growth service, which increases your number of followers both safely and practically.
– We guarantee to gain you 300-1000+ followers per month.
– People follow you because they are interested in you, increasing likes, comments and interaction.
– All actions are made manually by our team. We do not use any ‘bots’.
The price is just $60 (USD) per month, and we can start immediately.
If you’d like to see some of our previous work, let me know, and we can discuss it further.
Kind Regards,
Libby
Unsubscribe here: https://removeme.click/unsubscribe.php?d=nextgen.co.id