Friday, March 1, 2019

How to combine HTML with CSS

Actually there are three different ways to combine HTML file with CSS files. 
Here are three ways to combine HTML with CSS file:

1.Inline Style

Inline Style is a way of writing CSS file directly into the HTML tag, the following is an example of writing Inline Style:

<!DOCTYPE html>
<html>
<head>
<title>Merging HTML and CSS Files</title>
</head>
<body>
<p>
<h2 style="color:#FFCC00"> Example for Inline Style
</p>
</h2>
</body>
</html>
How to combine HTML with CSS


2.Embedded Style

Embedded Style is a way of writing CSS into an HTML file per page (Page) and writing a CSS file before .... </ Head>. 
Here is an example of writing:

<!DOCTYPE html>
<html>
<head>
<title> Merging HTML and CSS Files </title>
<style type="text/css">
h2 {
color:#FFCC00;
background:#CC0000;
}
</style>
</head>
<body>
<p>
<h2>Example for an Embedded Style
</p>
</h2>
</body>
</html>
How to combine HTML with CSS


3.Link Style

For writing Link Style is writing separately between the HTML file and a CSS file and we just put a link only, and installation can put your link in the <head> ... </ head>. 

For how Link Style is widely used by Web Design or programmer because of the way the Link Style is just one time writing CSS file that will be used by the entire Web page. 

Usually, Web Design Link Style CSS file name with name style.css. 
Here's an example file:

h2{
color: #FFCC00;
background: #CC0000;
}

Save stye.css file in the same directory with the html file that we will create and create a folder in the folder css css file input so impressed neat.



Create an HTML file with the following listing:

<html>
<head>
<title>Merging HTML and CSS files</title>
<link href=”css/style.css” rel=”stylesheet” type=”text/css” />
</head>
<body>
<p>
<h2>Example for Link Style
</p>
</h2>
</body>
</html>

How to combine HTML with CSS

Note:
  • To insert a link to a file style.css placement should be between <head> .... </ Head>.
  • You could make more than one css file as needed.





Next, you can learn  Property In CSS.


Reviewer: Fajar Yusuf
ItemReviewed: How to combine HTML with CSS

Seseorang yang ingin membagi pengalaman dan ilmu yang berguna untuk para pembaca FajarYusuf.Com :)

Cobalah untuk memilih Pelajaran Pemrograman dan belajar dari Materi Pertama
EmoticonEmoticon


TENTANG SITUS

SITUS INI ADALAH SITUS PEMBELAJARAN PEMROGRAMAN DAN JUGA PEMAHAMAN TERHADAP TEKNOLOGI KOMPUTER. KALIAN BISA MENGIKUTI PEMBELAJARAN PEMROGRAMAN DENGAN BERTAHAP PADA MATERI YANG SUDAH SAYA SEDIAKAN, JIKA ADA MATERI YANG MEMBINGUNGKAN SILAKAN LAKUKAN KOMENTAR PADA MATERI YANG ANDA TANYAKAN ATAU KALIAN BISA MENGHUBUNGI SAYA DIHALAMAN KONTAK.