CSS - Cascading Style Sheet
- Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation of a document written in a markup language such as HTML or XML (including XML dialects such as SVG, MathML or XHTML). CSS is a cornerstone technology of the World Wide Web, alongside HTML and JavaScript.
To use CSS with HTML document, there are three ways:
- Inline CSS: Define CSS properties using style attribute in the HTML elements.
- Internal or Embedded CSS: Define CSS using <style> tag in <head> section.
- External CSS: Define all CSS property in a separate .css file, and then include the file with HTML file using tag in section.
<!DOCTYPE HTMl>
<html>
<head>
<style>
.intro{text-align:center;color:blue}
</style>
</head>
<body>
<h1 class="intro">this heading is blue and center-aligned.</h1>
<p class="intro">this paragraph is blue and center-aligned.</p>
</body>
</html>
Output -:
this heading is blue and center-aligned.
this paragraph is blue and center-aligned.
No comments:
Post a Comment