lablab
p {
font-size: 20px;
color: purple;
}
</style>
</head>
<body>
<h1>This is a Heading with Internal Styles</h1>
<p>This is a paragraph with internal styles.</p>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>External Styles</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<h1>This is a Heading with External Styles</h1>
<p>This is a paragraph with external styles.</p>
</body>
</html>
- 3
- 4 <!DOCTYPE html>
5
<!DOCTYPE html>
6
Code.xml
<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/css" href="student.css"?> <students> <student> <sname>Ankush</sname> <usn>4SF15CS001</usn> <college>SCEM</college> <branch>CSE</branch> <yoj>2015</yoj> <email>[email protected]</email> </student> <student> <sname>Rayan</sname> <usn>4SF15CS003</usn> <college>SCEM</college> <branch>CSE</branch> <yoj>2015</yoj> <email>[email protected]</email> </student> <student> <sname>Pavan</sname> <usn>4SF15CS006</usn> <college>SCEM</college> <branch>CSE</branch> <yoj>2015</yoj> <email>[email protected]</email> </student> </students> student.cssstudents
{
background-color: pink;
font-family: ‘cambria';
}
student
{
display: block;
margin-bottom: 30pt;
margin-left: 0;
}
sname
{
display: block;
font-size: 15pt;
text-transform: uppercase;
color: blue;
}
usn:before
{
content: "USN: ";
font-size: 14pt;
font-weight: bold;
}
usn
{
display: block;
font-size: 14pt;
margin-left: 20pt;
text-transform: uppercase;
color: blueviolet;
}
college:before
{
content: "Affiliated College: ";
font-size: 14pt;
font-weight: bold;
}
college
{
display: block;
font-size: 14pt;
margin-left: 20pt;
color: blueviolet;
}
branch:before
{
content: "Branch: ";
font-size: 14pt;
font-weight: bold;
}
branch
{
display: block;
font-size: 14pt;
margin-left: 20pt;
color: blueviolet;
}
yoj:before
{
content: "Year of Joining: ";
font-size: 14pt;
font-weight: bold;
}
yoj
{
display: block;
font-size: 14pt;
margin-left: 20pt;
color: blueviolet;
}
email:before
{
content: "EMAILID: ";
font-size: 14pt;
font-weight: bold;
}
email
{
display: block;
font-size: 14pt;
margin-left: 20pt;
color: blueviolet;
}
7
<html> <head> <title>Visitors Count</title> <style type="text/css"> h1, h2 {text-align: center} </style> </head> <body> <h1>Welcome to MY WEB PAGE</h1> <?php $file = "count.txt"; $handle = fopen($file, 'r') or die("Cannot Open File: $file"); $count = fread($handle, 10); fclose($handle); $count++; echo "<h2>No of visitors who visited this page: $count</h2>"; $handle = fopen($file, 'w') or die("Cannot Open File: $file"); fwrite($handle, $count); fclose($handle); ?> </body> </html>8
<html> <head> <meta http-equiv="refresh" content="1"> <title>Digital Clock</title> <style type="text/css"> h1 {text-align: center} </style> </head> <body> <?php echo "<h1>Digital Clock</h1>"; echo "<hr/>"; echo "<h1>".date('h:i:s A')."</h1>"; echo "<hr/>"; ?> </body> </html>9 <!DOCTYPE html>
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Simple Calculator (PHP)</title> </head> <body> <h2>Simple Calculator (PHP)</h2> <form method="post" action=""> <input type="number" name="num1" placeholder="Number 1" required> <select name="operation"> <option value="add">+</option> <option value="subtract">-</option> <option value="multiply">*</option> <option value="divide">/</option> </select> <input type="number" name="num2" placeholder="Number 2" required> <button type="submit" name="calculate">Calculate</button> </form> <?php if (isset($_POST['calculate'])) { $num1 = isset($_POST['num1']) ? $_POST['num1'] : 0; $num2 = isset($_POST['num2']) ? $_POST['num2'] : 0; $op = isset($_POST['operation']) ? $_POST['operation'] : 'add'; switch ($op) { case 'add': $result = $num1 + $num2; break; case 'subtract': $result = $num1 - $num2; break; case 'multiply': $result = $num1 * $num2; break; case 'divide': $result = ($num2 != 0) ? $num1 / $num2 : 'Cannot divide by zero'; break; default: $result = 'Invalid operation'; break; } echo '<p>Result: ' . $result . '</p>'; } ?> </body> </html>