Fullstack Reference-1
Fullstack Reference-1
<h2>Unordered List</h2>
<ul>
<li>Notebook</li>
<li>Pen</li>
<li>Pencil</li>
</ul>
<h2>Nested Lists</h2>
<ul>
<li>Fruits
<ul>
<li>Apple</li>
<li>Mango</li>
</ul>
</li>
<li>Vegetables
<ol>
<li>Carrot</li>
<li>Beans</li>
</ol>
</li>
</ul>
<h2>Definition List</h2>
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>
</body>
</html>
1c. HTML Program – Images with Specific Size and Links to Profiles
html
CopyEdit
<!DOCTYPE html>
<html>
<head>
<title>Profile Images</title>
</head>
<body>
<h2>Our Profiles</h2>
<a href="[Link] target="_blank">
<img src="[Link]" alt="My Image" height="150" width="150">
</a>
<a href="[Link] target="_blank">
<img src="[Link]" alt="Friend Image" height="150"
width="150">
</a>
</body>
</html>
Replace [Link], [Link], and the profile URLs with actual paths and links.
Ensure [Link] are the small (100x100) thumbnail versions, and [Link] are the full-
size images.
2a. HTML Program – Basic Table with rowspan, colspan, and Borders
html
CopyEdit
<!DOCTYPE html>
<html>
<head>
<title>HTML Table Example</title>
</head>
<body>
<h2>Basic Table Example</h2>
<table border="1">
<tr>
<th>Sr. No.</th>
<th>Name</th>
<th colspan="2">Marks</th>
</tr>
<tr>
<td>1</td>
<td>John</td>
<td>80</td>
<td>90</td>
</tr>
<tr>
<td rowspan="2">2</td>
<td>Emma</td>
<td>85</td>
<td>88</td>
</tr>
<tr>
<td>Mike</td>
<td>78</td>
<td>82</td>
</tr>
</table>
</body>
</html>
html
CopyEdit
<!DOCTYPE html>
<html>
<head>
<title>College Timetable</title>
</head>
<body>
<h2>College Timetable</h2>
<table border="1" cellspacing="5" cellpadding="10">
<caption><strong>[Link] Class Timetable</strong></caption>
<tr>
<th>Day</th>
<th>9-10</th>
<th>10-11</th>
<th>11-12</th>
<th>12-1</th>
<th>1-2</th>
<th>2-3</th>
</tr>
<tr>
<td>Monday</td>
<td>Math</td>
<td>Physics</td>
<td>Chemistry</td>
<td rowspan="5">Lunch</td>
<td colspan="2">Lab</td>
</tr>
<tr>
<td>Tuesday</td>
<td>English</td>
<td colspan="2">Workshop</td>
<td>Sports</td>
<td>Library</td>
</tr>
<tr>
<td>Wednesday</td>
<td>Math</td>
<td>Computer</td>
<td>Electronics</td>
<td>Physics</td>
<td>Chemistry</td>
</tr>
<tr>
<td>Thursday</td>
<td colspan="3">Seminar</td>
<td colspan="2">Project</td>
</tr>
<tr>
<td>Friday</td>
<td>English</td>
<td>Math</td>
<td>Computer</td>
<td>Free</td>
<td>Quiz</td>
</tr>
</table>
</body>
</html>
⚠ Note: Modern HTML no longer supports <frameset> in HTML5. But for academic purposes,
here’s a classic example using it:
frameset_example.html:
html
CopyEdit
<!DOCTYPE html>
<html>
<head>
<title>HTML Frames Example</title>
</head>
<frameset rows="33%,33%,34%">
<frame src="[Link]">
<frame src="[Link]">
<frame src="[Link]">
</frameset>
<noframes>
<body>Your browser does not support frames.</body>
</noframes>
</html>
[Link]:
html
CopyEdit
<!DOCTYPE html>
<html>
<body>
<img src="[Link]" width="100%" height="100%">
</body>
</html>
[Link]:
html
CopyEdit
<!DOCTYPE html>
<html>
<body>
<p>This is a paragraph displayed in the second frame. It can contain any
information or description.</p>
</body>
</html>
[Link]:
html
CopyEdit
<!DOCTYPE html>
<html>
<body>
<h3>This is the third frame</h3>
<a href="[Link] target="_blank">Visit Google</a>
</body>
</html>
<header>
<h1>Welcome to My Blog</h1>
</header>
<nav>
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">Articles</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
<main>
<section>
<article>
<header>
<h2>HTML5 Structure</h2>
</header>
<p>HTML5 introduces new semantic elements to define parts of a web
page clearly.</p>
<figure>
<img src="[Link]" alt="HTML5 Logo" width="200">
<figcaption>Figure: HTML5 Logo</figcaption>
</figure>
</article>
</section>
<aside>
<h3>Quick Links</h3>
<ul>
<li><a href="#">Learn HTML</a></li>
<li><a href="#">Learn CSS</a></li>
</ul>
</aside>
</main>
<footer>
<p>© 2025 My Blog. All rights reserved.</p>
</footer>
</body>
</html>
<h2>Embedded Audio</h2>
<audio controls>
<source src="audio.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
<h2>Embedded Video</h2>
<video width="400" controls>
<source src="video.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
</body>
</html>
Replace audio.mp3 and video.mp4 with your actual media file names.
3c. HTML Program with Inline, Internal, and External CSS
html
CopyEdit
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS Types Example</title>
.internal-style {
color: green;
font-size: 18px;
}
</style>
</body>
</html>
css
CopyEdit
/* [Link] */
.external-style {
color: blue;
font-weight: bold;
font-size: 16px;
}
4. Selector forms
a. Write a program to apply different types of selector forms
i. Simple selector (element, id, class, group, universal)
ii. Combinator selector (descendant, child, adjacent sibling, general sibling)
iii. Pseudo-class selector
iv. Pseudo-element selector
v. Attribute selector
/* ID selector */
#main-title {
font-size: 24px;
color: darkgreen;
}
/* Class selector */
.highlight {
background-color: yellow;
font-weight: bold;
}
/* Group selector */
h2, h3 {
font-family: Arial, sans-serif;
}
/* Universal selector */
* {
margin: 5px;
}
/* Child selector */
ul > li {
color: darkred;
}
li:first-child {
font-weight: bold;
}
input:focus {
background-color: lightyellow;
}
p::before {
content: "→ ";
color: gray;
}
/* v. ATTRIBUTE SELECTORS */
input[type="text"] {
border: 2px solid blue;
}
a[target="_blank"] {
color: green;
text-decoration: underline;
}
</style>
</head>
<body>
<h3>Combinator Selectors</h3>
<div>
<p>This paragraph is inside a div (descendant).</p>
</div>
<ul>
<li>First child (child selector)</li>
<li>Second child</li>
</ul>
<p>This is after h3 (general sibling).</p>
<h2>Adjacent Paragraph</h2>
<p>This is an adjacent paragraph (adjacent sibling).</p>
<h2>Pseudo-class Selectors</h2>
<a href="#" target="_blank">Hover over this link</a><br><br>
<input type="text" placeholder="Focus here...">
<h2>Pseudo-element Selectors</h2>
<p>This paragraph uses ::first-line and ::before pseudo-elements.</p>
<h2>Attribute Selector</h2>
<input type="text" placeholder="Enter name">
<input type="password" placeholder="Enter password">
<br>
<a href="[Link] target="_blank">External Link</a>
</body>
</html>
✅ Explanation by Category:
5. CSS with Color, Background, Font, Text and CSS Box Model
a. Write a program to demonstrate the various ways you can reference a color in CSS.
b. Write a CSS rule that places a background image halfway down the page, tilting it
horizontally. The image should remain in place when the user scrolls up or down.
c. Write a program using the following terms related to CSS font and text: i. font-size ii. font-
weight iii. font-style iv. text-decoration v. text-transformation vi. text-alignment
d. Write a program, to explain the importance of CSS Box model using i. Content ii. Border iii.
Margin iv. padding
.hex-color {
color: #00FF00; /* Hexadecimal */
}
.rgb-color {
color: rgb(0, 0, 255); /* RGB */
}
.rgba-color {
color: rgba(255, 0, 0, 0.5); /* RGBA with transparency */
}
.hsl-color {
color: hsl(120, 100%, 50%); /* HSL */
}
.hsla-color {
color: hsla(240, 100%, 50%, 0.7); /* HSLA */
}
</style>
</head>
<body>
<p class="name-color">This is a named color (red).</p>
<p class="hex-color">This is a hexadecimal color (#00FF00).</p>
<p class="rgb-color">This is an RGB color (rgb(0, 0, 255)).</p>
<p class="rgba-color">This is an RGBA color (rgba(255, 0, 0, 0.5)).</p>
<p class="hsl-color">This is an HSL color (hsl(120, 100%, 50%)).</p>
<p class="hsla-color">This is an HSLA color (hsla(240, 100%, 50%,
0.7)).</p>
</body>
</html>
.text-style {
text-decoration: underline;
text-transform: uppercase;
text-align: center;
}
</style>
</head>
<body>
<p class="font-style">This text uses font-size, weight, and style.</p>
<p class="text-style">This line is underlined, uppercase, and
centered.</p>
</body>
</html>
// 2. [Link]
[Link]("This is written using [Link]<br>");
// 3. innerHTML
[Link]("demo").innerHTML = "This is using innerHTML";
// 4. [Link]
[Link]("This is shown in the console");
</script>
</body>
</html>
<script>
function displayInput() {
let age = [Link]("age").value;
[Link]("result").innerText = "Your age is: " +
age;
}
</script>
</body>
</html>
th, td {
border: 1px solid black;
padding: 10px;
text-align: center;
}
th {
background-color: lightgray;
}
</style>
</head>
<body>
<h2>Voter Eligibility Check</h2>
<script>
let name = prompt("Enter your name:");
let age = parseInt(prompt("Enter your age:"));
[Link]("<table>");
[Link]("<tr><th>Name</th><th>Age</th><th>Voting
Status</th></tr>");
[Link]("<tr><td>" + name + "</td><td>" + age + "</td><td>" +
status + "</td></tr>");
[Link]("</table>");
</script>
</body>
</html>
Concept Used In
Internal JS 6a (<script> in HTML)
External JS 6a (linked .js file)
Output Methods 6b (alert, [Link], innerHTML)
Input Methods 6c (prompt, form input)
Type Conversion 6d (parseInt)
Conditionals 6d (if / ternary operator)
function openWindow() {
[Link]("[Link] "_blank");
}
function confirmAction() {
let result = confirm("Do you want to continue?");
alert("You clicked: " + (result ? "OK" : "Cancel"));
}
// Example buttons
[Link]('<button onclick="openWindow()">Open Google</button>');
[Link]('<button onclick="confirmAction()">Confirm</button>');
</script>
</body>
</html>
// Method
[Link] = function () {
return [Link] + " is " + [Link] + " years old, in grade "
+ [Link];
};
// Accessor (getter)
[Link] = function () {
return [Link];
};
// Accessor (setter)
[Link] = function (newGrade) {
[Link] = newGrade;
};
}
[Link]("11th");
[Link]("Updated Grade: " + [Link]());
</script>
</body>
</html>
✅ Summary
switch (day) {
case 1: [Link]("Sunday"); break;
case 2: [Link]("Monday"); break;
case 3: [Link]("Tuesday"); break;
case 4: [Link]("Wednesday"); break;
case 5: [Link]("Thursday"); break;
case 6: [Link]("Friday"); break;
case 7: [Link]("Saturday"); break;
default: [Link]("Invalid input!");
}
</script>
</body>
</html>
[Link]("<h3>Denomination Breakdown</h3>");
for (let i = 0; i < [Link]; i++) {
let note = [Link](amount / denominations[i]);
if (note > 0) {
[Link](note + " - " + denominations[i] + "'s<br>");
amount %= denominations[i];
}
}
</script>
</body>
</html>
✅ Summary Table
function fibonacci(n) {
let fib = [0, 1];
for (let i = 2; i < n; i++) {
fib[i] = fib[i - 1] + fib[i - 2];
}
return [Link](0, n);
}
function isPrime(num) {
if (num < 2) return false;
for (let i = 2; i <= [Link](num); i++) {
if (num % i === 0) return false;
}
return true;
}
function primeUpto(n) {
let primes = [];
for (let i = 2; i <= n; i++) {
if (isPrime(i)) [Link](i);
}
return primes;
}
function isPalindrome(num) {
let str = [Link]();
let reversed = [Link]("").reverse().join("");
return str === reversed;
}
// Example Calls:
let number = 7;
[Link]("Factorial of " + number + " is " + factorial(number) +
"<br>");
[Link]("Fibonacci series up to " + number + ": " +
fibonacci(number).join(", ") + "<br>");
[Link]("Prime numbers up to " + number + ": " +
primeUpto(number).join(", ") + "<br>");
[Link](number + (isPalindrome(number) ? " is a Palindrome" : "
is NOT a Palindrome"));
</script>
</body>
</html>
<script>
function getNumber() {
return parseInt([Link]("numBox").value);
}
function displayFactorial() {
let n = getNumber();
let result = 1;
for (let i = 2; i <= n; i++) result *= i;
[Link]("result").innerText = "Factorial: " +
result;
}
function displayFibonacci() {
let n = getNumber();
let fib = [0, 1];
for (let i = 2; i < n; i++) fib[i] = fib[i - 1] + fib[i - 2];
[Link]("result").innerText = "Fibonacci: " +
[Link](0, n).join(", ");
}
function displayPrimes() {
let n = getNumber();
let primes = [];
for (let i = 2; i <= n; i++) {
let isPrime = true;
for (let j = 2; j <= [Link](i); j++) {
if (i % j === 0) {
isPrime = false;
break;
}
}
if (isPrime) [Link](i);
}
[Link]("result").innerText = "Primes: " +
[Link](", ");
}
function checkPalindrome() {
let n = getNumber();
let str = [Link]();
let rev = [Link]("").reverse().join("");
let message = (str === rev) ? "It is a Palindrome" : "It is NOT a
Palindrome";
[Link]("result").innerText = message;
}
</script>
</body>
</html>
<script>
function validateForm() {
let name = [Link]("name").[Link]();
let mobile = [Link]("mobile").[Link]();
let email = [Link]("email").[Link]();
let error = "";
// i. Name Validation
if (!/^[A-Za-z][A-Za-z0-9]{5,}$/.test(name)) {
error += "Invalid name. Minimum 6 characters, starts with
letter.<br>";
}
[Link]("errorMsg").innerHTML = error;
✅ Summary Table: