<fieldset>
<legend>CSS fieldset</legend>
</fieldset>
<fieldset>
<legend>HTML element</legend>
</fieldset>
<fieldset>
<legend>JavaScript</legend>
</fieldset>
<fieldset>
<legend>TypeScript</legend>
</fieldset>
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap");
*,
*::before,
*::after {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html,
body {
width: 100%;
height: 100%;
}
body {
display: flex;
justify-content: center;
align-items: center;
font-family: "Poppins", sans-serif;
}
fieldset {
position: absolute;
width: 300px;
height: 300px;
border: 10px solid transparent;
border-top-color: black;
}
legend {
font-weight: bold;
font-size: 24px;
line-height: 10px;
margin-left: 16px;
padding: 0 12px;
animation: move 3s infinite linear alternate;
}
fieldset:nth-of-type(2) {
transform: rotate(90deg);
}
fieldset:nth-of-type(3) {
transform: rotate(180deg);
}
fieldset:nth-of-type(3) > legend {
transform: rotate(180deg);
}
fieldset:nth-of-type(4) {
transform: rotate(-90deg);
}
@keyframes move {
100% {
margin-left: 70px;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.