HTML Paragraph Tag
The <p> tag in HTML stands for "paragraph". It's used to define blocks of text as paragraphs, and it automatically adds some space before and after the text to separate it from other elements.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
padding: 30px;
}
.counter {
font-size: 48px;
margin-bottom: 20px;
}
button {
padding: 10px 20px;
margin: 5px;
font-size: 18px;
border: none;
border-radius: 5px;
cursor: pointer;
}
.increment {
background-color: #28a745;
color: white;
}
.reset {
background-color: #dc3545;
color: white;
}
@media (max-width: 600px) {
.counter {
font-size: 36px;
}
button {
width: 100%;
font-size: 16px;
}
}
</style>
</head>
<body>
<div class="counter" id="count">0</div>
<button class="increment" onclick="increment()">Increment</button>
<button class="reset" onclick="reset()">Reset</button>
<script>
let count = 0;
function increment() {
count++;
document.getElementById("count").innerText = count;
}
function reset() {
count = 0;
document.getElementById("count").innerText = count;
}
</script>
</body>
</html>