EN
CSS - outline with padding and radius
5
points
In this article, we would like to show how to create an outline
with padding and radius using CSS.
To get outline
padding effect we need to use one element nested in the second one.
Quick solution:
// ONLINE-RUNNER:browser;
<!doctype html>
<html>
<head>
<style>
a.outline {
padding: 4px; /* <----------------------------- required */
border-radius: 6px; /* <----------------------- required */
box-shadow: 0px 0px 0px 5px #fff183; /* <------ required */
display: inline-block;
}
span.content {
padding: 2px 5px;
border-radius: 3px;
background: #f7df1e;
font-family: "Segoe UI";
font-size: 16px;
color: black;
display: inline-block;
}
</style>
</head>
<body>
<a class="outline">
<span class="content">
#JavaScript
</span>
</a>
</body>
</html>