Heart Pattern - HTML CSS JavaScript
Result:
Code: HTML + CSS + JavaScript
<!--
tpvncode.blogspot.com
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Heart Pattern</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #1677d8;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
color: red;
text-shadow: 0px 0px 8px red;
font-size: 40px;
font-weight: bold;
}
</style>
</head>
<body>
<script>
let n = 6;
let string = "";
for (let i = 1; i <= n; i++) {
for (let j = 1; j <= i; j++) {
string += "❤️ ";
}
string += "<br>";
}
document.write(
`<pre>${string}</pre>`
);
</script>
</body>
</html>