2) Implement CSS with HTML
1) Inline Style - we can use this method with style attribute.
2) Internal Style - we can use this method inside the head section with <style> tag.
3) External Style Sheet - This method will work external css files only.
1) Inline Style
<h1 style="color:red;font-size:14px;">
Welcome to core css blog
</h1>
2) Internal Style
<html>
<head>
<style>
h1{
color:red;
font-size:14px;
}
</style>
</head>
<body>
<h1>
Welcome to core css blog
</h1>
</body>
</html>
3) External Style Sheet
An external style sheet is a separate document that contains only CSS rules. An external style sheet helps to change the look of an entire website by changing just one css file. It should not contain any HTML Tags. It has .css extension.
CSS Code:
p{color:red,font-size:24px;}
h1{color:blue;font-size:24em;}
1. Open notepad++ or any other Editor or IDE
2. Write CSS Code
3. Save with .css extension for example style.css
After that inside the head tag we will create a link tag with following attributes and values:
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
Comments
Post a Comment