Ex(1-4)
Ex(1-4)
: 1 (a)
Date :
Aim:
Procedure:
Study of Basic HTML Tags
9. <href> - attribute specifies the URL of the page the link goes to
Ex:
<h2>The href Attribute</h2>
<a href="https://www.w3schools.com">Visit W3Schools</a>
Output:
11. <a> - tag defines a hyperlink, which is used to link from one page to
another
Ex:
<html>
<body>
<h1>The a target attribute</h1>
<a href="https://www.w3schools.com" target="_blank">Visit
W3Schools.com!</a>
</body>
</html>
Output:
12. <b> - tag specifies bold text without any extra importance
Ex:
<h1>Use CSS to Set Bold Text</h1>
<p>Welcome To <b> Sona College of Technology</b> </p>
Output:
13. <br> - tag inserts a single line break, it has no end tag.
Ex:
<h1>A Poem</h1>
<p>Be not afraid of greatness.<br>
Some are born great,<br>
some achieve greatness,<br>
and others have greatness thrust upon them.</p>
Output:
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
<li>Water</li>
<li>Juice</li>
<li>Beer</li>
</ol>
Output:
<ul> - we can create the unordered list, It lists the item intended with a
bullet
Ex:
<h1>A list inside another list</h1>
<ul>
<li>Coffee</li>
<li>Tea
<ul>
<li>Black tea</li>
<li>Green tea</li>
</ul>
</li>
<li>Milk</li>
</ul>
Output:
17. <style> - attribute is used to add styles to an element, such as color,
font, size, and more
Ex:
<html>
<body>
<p style="color:red;">This is a red paragraph.</p>
</body>
</html>
Output:
25. Class - attribute is often used to point to a class name in a style sheet
<div class="city">
<h2>London</h2>
<p>London is the capital of England.</p>
</div>
26. <iframe> - tag specifies an inline frame
Ex:
<iframe src="demo_iframe.htm" height="200" width="300" title="Iframe
Example"></iframe>
27. <form> - element is used to create an HTML form for user input
i. <input> element is the most used form element.
<input type="text"> defines a single-line input field
<label> tag defines a label for many form elements
<input type="radio"> defines a radio button
<input type="checkbox"> defines a checkbox
<input type="submit"> defines a button for submitting the form
data
Result:
Ex.No. : 1 (b)
Date :
Aim:
Procedure:
Study of Basic CSS Properties
1. Universal Selector (*)
Description: Selects all elements on the page.
Example:
* { color: red; }
2. Type Selector (Element Selector)
Description: Selects all elements of a specific type.
Example:
p { color: blue; }
3. Class Selector (.)
Description: Selects all elements with a specific class.
Example:
.box { background-color: yellow; }
4. ID Selector (#)
Description: Selects an element with a specific ID.
Example:
#header { font-size: 20px; }
5. Descendant Selector (Space)
Description: Selects elements that are descendants of another element.
Example:
div p { color: green; }
6. Child Selector (>)
Description: Selects direct child elements of a specified element.
Example:
div > p { color: orange; }
7. Attribute Selector ([attribute])
Description: Selects elements with a specific attribute.
Example:
input[type="text"] { border: 2px solid black; }
8. Pseudo-classes (:)
Description: Selects elements in a specific state.
Example:
a:hover { color: red; }
9. Pseudo-elements (::)
Description: Selects part of an element, like the first letter or first line.
Example:
p::first-letter { font-weight: bold; }
10. Grouping Selector (,)
Description: Selects multiple elements at once.
Example:
h1, h2, h3 { font-family: Arial, sans-serif; }
11. Adjacent Sibling Selector (+)
Description: Selects an element that is immediately preceded by a specified
element.
Example:
h1 + p { color: blue; }
12. General Sibling Selector (~)
Description: Selects all elements that are siblings of a specified element.
Example:
h1 ~ p { color: green; }
Result:
Ex.No. : 2 (a)
Date :
Aim:
Procedure:
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dhoni's Cricket Blog</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
nav {
background-color: #0a3d62;
color: #fff;
padding: 10px;
text-align: center;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
nav a {
color: #fff;
margin: 0 15px;
text-decoration: none;
font-weight: bold;
}
main {
padding: 20px;
}
.welcome-section {
text-align: center;
background-color: #fff;
border-radius: 10px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 30px;
}
.welcome-section img {
max-width: 100%;
height: auto;
display: block;
margin: 10px auto 20px;
border-radius: 8px;
}
#sections {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-top: 20px;
}
.section {
flex: 1 1 300px;
background-color: #fff;
border-radius: 10px;
padding: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}
.section img {
max-width: 100%;
height: auto;
display: block;
margin: 0 auto 15px;
border-radius: 8px;
}
.section h3 {
margin-top: 0;
color: #333;
}
#sections {
flex-direction: column;
}
}
</style>
</head>
<body>
<nav>
<a href="#">Home</a>
<a href="#sections">Highlights</a>
<a href="#career">Career</a>
<a href="#contact">Contact</a>
</nav>
<main>
<section class="welcome-section">
<h2>Welcome to Dhoni's Cricket Blog</h2>
<img src="ms1.jpg" alt="MS Dhoni Image">
<p>Explore the legendary journey of Mahendra Singh Dhoni — the Captain Cool of
Indian cricket. From humble beginnings to World Cup triumphs, witness it all here.</p>
</section>
<h2>Dhoni Highlights</h2>
<section id="sections">
<div class="section">
<img src="ms2.jpg" alt="Dhoni World Cup">
<h3>2011 World Cup Glory</h3>
<p>Dhoni's unforgettable six sealed the deal for India in the 2011 ICC Cricket
World Cup final. A moment etched in history.</p>
</div>
<div class="section">
<img src="ms3.jpg" alt="Dhoni Captaincy">
<h3>Captaincy Legacy</h3>
<p>Known for his calm demeanor, Dhoni led India to multiple ICC trophies and
transformed the team into world-beaters.</p>
</div>
<div class="section">
<img src="ms4.avif" alt="Dhoni in IPL">
<h3>IPL Legend</h3>
<p>As the captain of Chennai Super Kings, Dhoni has guided the team to numerous
IPL titles with his brilliant leadership.</p>
</div>
</section>
<section id="career">
<h2>Dhoni's Career Stats</h2>
<p>Over 10,000 ODI runs, numerous match-winning knocks, and leadership records
— Dhoni’s career remains inspirational for generations.</p>
</section>
<section id="contact">
<h2>Contact Us</h2>
<p>Have questions or want to contribute? Reach out and be part of Dhoni’s fan
community!</p>
</section>
</main>
</body>
</html>
Output:
Result:
Ex.No. : 2 (b)
Date :
Aim:
Procedure:
Program:
Code to design a responsive blog using html and css
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>MS Dhoni Fan Blog</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
line-height: 1.6;
}
nav {
background: #003366;
color: #fff;
text-align: center;
padding: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
nav a {
color: #fff;
text-decoration: none;
margin: 0 15px;
font-weight: bold;
}
.welcome-section {
text-align: center;
background: #fff;
padding: 20px;
margin: 20px auto;
max-width: 1200px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.welcome-section img {
max-width: 100%;
height: auto;
border-radius: 8px;
margin-bottom: 20px;
}
#services {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin: 20px auto;
max-width: 1200px;
padding: 0 10px;
}
.service {
flex: 1;
min-width: 300px;
background: #fff;
padding: 20px;
text-align: center;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.service img {
max-width: 100%;
height: auto;
border-radius: 8px;
margin-bottom: 15px;
}
#projects, #contact {
max-width: 1200px;
margin: 20px auto;
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
footer {
background: #003366;
color: #fff;
text-align: center;
padding: 15px 0;
}
<section class="welcome-section">
<h1>Welcome to the MS Dhoni Fan Blog</h1>
<img src="dhoni1.jpg" alt="MS Dhoni in action" />
<p>Celebrate the legacy of Captain Cool — Mahendra Singh Dhoni. From stunning
finishes to iconic leadership moments, relive Dhoni’s cricketing journey with us.</p>
</section>
<section id="projects">
<h2>Career Milestones</h2>
<p>From his debut in 2004 to his retirement, explore major milestones like his double
century, IPL wins with CSK, and more.</p>
</section>
<section id="contact">
<h2>Contact Us</h2>
<p>Are you a Dhoni fan too? Share your thoughts or contribute to this blog!</p>
</section>
<footer>
<p>© 2025 Dhoni Fan Club. All rights reserved.</p>
</footer>
</body>
</html>
Output
Result:
Ex.No. : 3
Date :
Aim:
Procedure:
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="https://cdn.jsdelivr.net/npm/[email protected]
alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container">
<span class="navbar-toggler-icon"></span>
</button>
</ul>
</div>
</div>
</nav>
</section>
<div class="col-md-4">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card h-100">
</div>
</div>
</div>
<div class="col-md-4">
<h5 class="card-title">Renovation</h5>
</div>
</div>
</div>
</div>
</section>
</section>
<!-- Contact Section -->
<p class="text-center">Feel free to reach out to us for inquiries or assistance with your
construction needs!</p>
</section>
<script src="https://cdn.jsdelivr.net/npm/[email protected]
alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
Output:
Result
Ex.No. : 4
Date :
Aim:
Procedure:
Program:
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://cdn.jsdelivr.net/npm/[email protected]
alpha1/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<style>
body {
.welcome-section {
background-size: cover;
color: white;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
flex-direction: column;
.welcome-section h1 {
font-size: 4rem;
margin-bottom: 20px;
.welcome-section p {
font-size: 1.2rem;
.btn-welcome {
margin-top: 20px;
.service-desc {
display: none;
margin-top: 10px;
</style>
</head>
<body>
<section class="welcome-section">
<h1>Welcome to MS Dhoni Blog</h1>
</section>
<div class="container">
<span class="navbar-toggler-icon"></span>
</button>
</ul>
</div>
</div>
</nav>
<div class="col-md-4">
<div class="card-body">
<p class="service-desc">As a young captain, Dhoni led India to its first T20
World Cup victory, setting the tone for a new era of Indian cricket.</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card-body">
</div>
</div>
</div>
<div class="col-md-4">
<div class="card-body">
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function () {
$(".toggle-btn").click(function () {
$(this).siblings(".service-desc").slideToggle();
$(this).text(newText);
});
});
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]
alpha1/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>
OUTPUT :
Result: