<div class="first">A</div>
<div class="second">B</div>
div {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100px;
  height: 50px;
  float:left;
}

.first {
  background:blue;
}

.first:hover {
  border: 5px solid black;
}

.second {
  margin-left: 10px;
  background:red;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.