0

The effect I would like to achieve is whether you hover over the "Icon" or the "Title" text that the "Icon" scales, the "Icon" background changes color, and the the "Title" changes color. I do not want the "Title" to scale.

Right now when you hover over the "Title" it has the desired effect, I just can't seem to get the title to change color when you over over the icon area.

Here is the fiddle http://jsfiddle.net/6suqg1mL/.

HTML

<div>
  <a href="#" class="icon-circle">Icon
    <p class="icon-title">Title</p>
  </a>
</div>

CSS

.icon-circle {
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 66px;
  border: 5px solid #000000;
  font-size: 20px;
  color: #000000;
  line-height: 100px;
  text-align: center;
  text-decoration: none;
  background: rgba(0, 0, 0, .1);
  -webkit-transition: all 700ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
  -moz-transition: all 700ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
  -o-transition: all 700ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
  transition: all 700ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
}

.icon-circle:hover {
  border: 5px solid #000000;
  color: blsvk;
  text-decoration: none;
  background: rgba(255, 0, 0, .3);
  font-size: 30px;
  /* ease-in-out */
}    

.icon-title {
  line-height: 20px;
  text-align: center;
  font-size: 40px;
}

.icon-title:hover {
  color: red;
}

2 Answers 2

1

You can use this .icon-circle:hover .icon-title selector when user hover over the .icon-circle then change the color of .icon-title.

.icon-circle:hover .icon-title {
  color: red; 
}

Jsfiddle

.icon-circle {
  display: block;
  width: 100px;
  height: 100px;
  border-radius: 66px;
  border: 5px solid #000000;
  font-size: 20px;
  color: #000000;
  line-height: 100px;
  text-align: center;
  text-decoration: none;
  background: rgba(0, 0, 0, .1);
  -webkit-transition: all 700ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
  -moz-transition: all 700ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
  -o-transition: all 700ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
  transition: all 700ms cubic-bezier(0.420, 0.000, 0.580, 1.000);
  /* ease-in-out */
}
.icon-circle:hover {
  border: 5px solid #000000;
  color: blsvk;
  text-decoration: none;
  background: rgba(255, 0, 0, .3);
  font-size: 30px;
  /* ease-in-out */
}
.icon-title {
  line-height: 20px;
  text-align: center;
  font-size: 40px;
}
.icon-circle:hover .icon-title {
  color: red;
}
<div>
  <a href="#" class="icon-circle">Icon
<p class="icon-title">Title</p>
</a>
</div>

Sign up to request clarification or add additional context in comments.

Comments

0

I believe this will do it-

  .icon-circle:hover > .icon-title {
      color:red;
    }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.