A Pen by Stephy

Thumbnail
This awesome code was written by blindingstars, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright blindingstars ©

Technologies

  • HTML
  • CSS
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>A Pen by  Stephy</title>
  
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">

  
      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div class="container">
	<span>Solid</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>Plain old regular buttons</span>
</div>

<div class="container outline">
	<span>Outline</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>But if you just add a border to the outline class, the buttons get too big (even with box-sizing)</span>
</div>

<div class="container solid-with-border">
	<span>Solid With Border</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>The fix? Add the border to the solid version as well, and adjust the padding if you want</span>
</div>

<div class="container final">
	<span>Final</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>Now, put it together with your <code>:hover</code> effect and you are good to go!</span>
</div>

<div class="container final extra-credit">
	<span>Extra Credit</span>
	<a href="#" class="btn">Button</a>
	<a href="#" class="btn">Button</a>
	<span>Transitions are an advanced technique that can create some visual interest (these fade and change color, for example)</span>
</div>
  
  

</body>

</html>

/*Downloaded from https://www.codeseek.co/blindingstars/a-pen-by-stephy-xreqXz */
.btn {
  text-decoration: none;
  color: #fff;
  background: mediumseagreen;
  font-weight: bold;
  display: inline-block;
  padding: 10px 15px;
  border-radius: 8px;
}

.outline .btn {
  color: mediumseagreen;
  border: 3px solid mediumseagreen;
  background: transparent;
}

.solid-with-border .btn {
  border: 3px solid mediumseagreen;
  padding: 7px 12px;
}

.final .btn {
  border: 3px solid mediumseagreen;
  background-color: mediumseagreen;
  padding: 7px 12px;
}

.final .btn:hover {
  background-color: transparent;
  color: mediumseagreen;
}

.extra-credit .btn {
  transition: all 0.2s ease-in-out;
}

.extra-credit .btn:hover {
  border-color: yellowgreen;
  color: yellowgreen;
}

.container {
  margin: 20px;
}

.btn + .btn {
  margin-left: 5px;
}

.container span {
  min-width: 200px;
  display: inline-block;
  margin: 0 10px;
}

.container span:first-of-type {
  font-weight: bold;
  text-align: right;
}

Comments