In HTML, "style" refers to the visual presentation and formatting of elements on a webpage. Styling is achieved through the use of CSS (Cascading Style Sheets), which is applied to HTML elements to control aspects such as colors, fonts, spacing, alignment, layout, and other visual features.
There are several important reasons why styling is used in HTML:
In this example, a style is applied directly to an element using the style
attribute:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome To My Style Page</title>
</head>
<body>
<p style="color:blue; font-size: 18px;">This paragraph has inline styling applied directly to it.</p>
</body>
</html>
This paragraph has inline styling applied directly to it.
Internal CSS is defined within the <style>
tag in the <head>
section. Here's an example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome To My Style Page</title>
<style>
h2 {
color: #8e44ad;
font-size: 24px;
}
</style>
</head>
<body>
<h2>(Ait) Academy Of Information Technology</h2>
<h2>We are in training since 20+ years in Computer Programming & Hardware Networking</h2>
</body>
</html>
(Ait) Academy Of Information Technology;
We are in training since 20+ years in Computer Programming & Hardware Networking.
Paragraphs can also contain other HTML elements, such as links, bold, and italic text:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome To My Style Page</title>
</head>
<body>
<p>Visit our website at <a href="http://aitaurangabad.com/">example.com</a> for more information.</p>
<p>This is <strong>bold</strong> and this is <em>italic</em> text within a paragraph.</p>
</body>
</html>
Visit our website at Aitaurangabad.com for more information.
This is bold and this is italic text within a paragraph.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome To My Style Page</title>
</head>
<body>
<h1>Hello Ait's Students</h1>
<p>How are you all</p>
</body>
</html>
Hello Ait's Students
How are you all
Styles are an essential part of web design that help make content visually appealing, organized, and user-friendly. By using CSS, you can ensure that your webpage looks good, is accessible, and performs well across different devices. Whether you use inline, internal, or external styles, incorporating them effectively can enhance the overall design and experience of your website.