I am trying to change the colour of an h2 tag inside a div.
The other elements inside this div change to white colour when hovered over, only the h2 does not change colour.
I know I can change this in CSS... .well.sb:hover, .well.sb:hover h2, but the bad thing with that is that the h2 part changes colour separately from the rest. When hovering over the whole thing, everything (including h2) should change text-color into white at the same time and at the same speed and for the same one big and only div section. How to make that work?
h2.title-article-sidebar {
font-size: 14px;
font-family: Calibri;
color: #444;
font-weight: 700;
line-height: 1.25em;
margin-top: 0;
}
.article-image-summary-sidebar {
border: 0 solid;
padding-bottom: 0;
-moz-transition: .9s ease;
-webkit-transition: .9s ease;
-o-transition: .9s ease;
-ms-transition: .9s ease;
transition: .9s ease;
}
.well.sb:hover {
color: #FFF;
background-color: #A10000;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
<div class="well sb"><div>
<div class="article-image-summary-sidebar">
<img alt="X" src="http://loremxpixel.com/200/200">
<div class="article-date-summary-sidebar">
20-November-2010
</div>
<div class="article-tag-summary-sidebar">
TAG
</div>
<h2 class="title-article-sidebar">
TITLE WITH H2 TAG!!!!
</h2>
</div>
</div></div>
There are 2 things happening. First, you need to target the h2 more specifically (it's overriding your hover styles). Second, you have conflicting transitions.
h2.title-article-sidebar {
font-size: 14px;
font-family: Calibri;
color: #444;
font-weight: 700;
line-height: 1.25em;
margin-top: 0;
}
.article-image-summary-sidebar {
border: 0 solid;
padding-bottom: 0;
/* -moz-transition: .9s ease;
-webkit-transition: .9s ease;
-o-transition: .9s ease;
-ms-transition: .9s ease;
transition: .9s ease; */
}
.well.sb:hover {
color: #FFF;
background-color: #A10000;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.well.sb:hover h2.title-article-sidebar {
color: #FFF;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
<div class="well sb"><div>
<div class="article-image-summary-sidebar">
<img alt="X" src="http://loremxpixel.com/200/200">
<div class="article-date-summary-sidebar">
20-November-2010
</div>
<div class="article-tag-summary-sidebar">
TAG
</div>
<h2 class="title-article-sidebar">
TITLE WITH H2 TAG!!!!
</h2>
</div>
</div></div>
Just remove color: #444; from h2.title-article-sidebar
Recent version of chrome tend to add transitions in nested elements (not sure about it is a bug or a feature).
Just make sure that children don't have an inherited transition
h2.title-article-sidebar {
font-size: 14px;
font-family: Calibri;
color: #444;
font-weight: 700;
line-height: 1.25em;
margin-top: 0;
}
.article-image-summary-sidebar {
border: 0 solid;
padding-bottom: 0;
-moz-transition: .9s ease;
-webkit-transition: .9s ease;
-o-transition: .9s ease;
-ms-transition: .9s ease;
transition: .9s ease;
}
.well.sb:hover {
color: #FFF;
background-color: #A10000;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.sb * {
transition: 0s;
}
<div class="well sb">
<div>
<div class="article-image-summary-sidebar">
<img alt="X" src="http://loremxpixel.com/200/200">
<div class="article-date-summary-sidebar">
20-November-2010
</div>
<div class="article-tag-summary-sidebar">
TAG
</div>
<h2 class="title-article-sidebar">
TITLE WITH H2 TAG!!!!
</h2>
</div>
</div>
</div>
This will solve it:
h2.title-article-sidebar {
font-size: 14px;
font-family: Calibri;
/* color: #444;*/
font-weight: 700;
line-height: 1.25em;
margin-top: 0;
}
.article-image-summary-sidebar {
border: 0 solid;
padding-bottom: 0;
}
.well.sb:hover {
color: #FFF;
background-color: #A10000;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
<div class="well sb"><div>
<div class="article-image-summary-sidebar">
<img alt="X" src="http://loremxpixel.com/200/200">
<div class="article-date-summary-sidebar">
20-November-2010
</div>
<div class="article-tag-summary-sidebar">
TAG
</div>
<h2 class="title-article-sidebar">
TITLE WITH H2 TAG!!!!
</h2>
</div>
</div></div>
You don't have any problem in your animation as mentioned in some other answers. You have correctly written your code nor there is any specificity problem.
I am attaching a codepen link on which I was trying to solve your problem:
http://codepen.io/Sky-123/pen/mALGQZ
The animations remains intact as you have written them. The only change that I did was added the color:#444 to h2 tag through an inline statement and then removed it on hover in jQuery as it was causing concerns in animation..
Hope it solves your problem.
Related
I'm trying to get my my button to transition on hover so the button squeezes to the left. However, there is no transition occurring on hover. Any suggestions?
.BtnEvents {
background-color: #048431;
/* FRB Green */
margin: 10px 0px;
padding: 16px 30px;
height: 50px;
transition: all 200ms ease;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
-o-transition: all 200ms ease;
-ms-transition: all 200ms ease;
fit: fill;
display: inline-block;
overflow: visible;
color: white;
font-size: 18px;
font-family: 'Sofia Pro', sans-serif;
line-height: 20px;
text-decoration: none;
position: static;
border: 0;
cursor: pointer;
font-weight: 400px;
}
.BtnEvents:hover {
transition: all 200ms ease;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
-o-transition: all 200ms ease;
-ms-transition: all 200ms ease;
}
Register Now!
.BtnEvents {
background-color: #048431;
/* FRB Green */
margin: 10px 0px;
padding: 16px 30px;
height: 50px;
transition: all 200ms ease;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
-o-transition: all 200ms ease;
-ms-transition: all 200ms ease;
fit: fill;
display: inline-block;
overflow: visible;
color: white;
font-size: 18px;
font-family: 'Sofia Pro', sans-serif;
line-height: 20px;
text-decoration: none;
border: 0;
cursor: pointer;
font-weight: 400px;
transition: all 200ms ease;
-webkit-transition: all 200ms ease;
-moz-transition: all 200ms ease;
-o-transition: all 200ms ease;
-ms-transition: all 200ms ease;
}
.BtnEvents:hover {
width: 200px;
}
Register Now!
Basically i have 2 columns and the left side has an overlaying grey image to create a kind of blur effect. When you mouseover it, it will turn see-through. It works well in Chrome/Safari but not in Firefox and i can't really figure out why.
I uploaded a link to my site to show what i mean:
http://generowicz.nl/showing_template.html
When viewed in Firefox the overlaying image doesnt fit and overlay the whole left side.
html, body {
height: 100%;
margin: 0;
font-size: 15px;
font-family: Helvetica;
font-weight: lighter;
}
#left{
text-indent:1cm;
width: 20%;
height: 100%;
position: fixed;
background: rgba(51,51,51,1);
}
#right {
padding-top:2cm;
width: 80%;
height: auto;
position: absolute;
right: 0;
background: white;
}
#img {
position: absolute;
opacity: 0.4;
width:100%;
height:100%;
pointer-events:none;
-webkit-transition: opacity .25s ease-out;
-moz-transition: opacity .25s ease-out;
-o-transition: opacity .25s ease-out;
transition: opacity .25s ease-out;
color:#000;
}
#left:hover>#img {
opacity: 0;
}
h1{
font-size: 80px;
color:#CCC;
}
h2 {
font-size: 15px;
color: #CCC;
font-weight: lighter;
}
h3 {
font-size: 15px;
color:#CCC;
}
/* These are for main body */
h4 {
font-size: 15px;
color:#000;
}
h5 {
font-size: 15px;
color:#000;
font-weight: lighter;
}
a.one:link {
text-decoration: none;
color: #CCC;
-webkit-transition: all 0.5s ease-out; Saf3.2+, Chrome
-moz-transition: all 0.5s ease-out; FF4+
-ms-transition: all 0.5s ease-out; IE10
-o-transition: all 0.5s ease-out; Opera 10.5+
transition: all 0.5s ease-out;
}
a.one:link:hover {
text-decoration: none;
color: #09F;
}
a.one:visited {
text-decoration: none;
color: #CCC;
-webkit-transition: all 0.5s ease-out; Saf3.2+, Chrome
-moz-transition: all 0.5s ease-out; FF4+
-ms-transition: all 0.5s ease-out; IE10
-o-transition: all 0.5s ease-out; Opera 10.5+
transition: all 0.5s ease-out;
}
a.one:visited:hover {
text-decoration: none;
color: #09F;
}
a.one:active { text-decoration: none;
color: #CCC;
-webkit-transition: all 0.5s ease-out; Saf3.2+, Chrome
-moz-transition: all 0.5s ease-out; FF4+
-ms-transition: all 0.5s ease-out; IE10
-o-transition: all 0.5s ease-out; Opera 10.5+
transition: all 0.5s ease-out;
}
<body>
<div id="left"><img src="images/graysmall.png" name="img" width="93" height="55" id="img" />
<h1> B </h1>
<h2><a class="one" href="../index.html">Home</a></h2>
<h2><a class="one" href="../about.html">About Me</a></h2>
<h2><a class="one" href="../contact.html">Contact</a></h2>
</div>
<div id="right">
<table width="100%" border="0" align="left">
<tr>
<td width="5%"> </td>
<td width="95%" align="left" valign="top">
<!-- TemplateBeginEditable name="Content" -->
<!-- TemplateEndEditable -->
</td>
</tr>
</table>
</div>
</body>
Adding left:0 in your #img class will give the result you need. See the updated class below,
#img {
position: absolute;
opacity: 0.4;
width: 100%;
height: 100%;
pointer-events: none;
-webkit-transition: opacity .25s ease-out;
-moz-transition: opacity .25s ease-out;
-o-transition: opacity .25s ease-out;
transition: opacity .25s ease-out;
color: #000;
left: 0;
}
Because you have not commented these lines Saf3.2+, Chrome , FF4+ etc
-webkit-transition: all 0.5s ease-out; /* Saf3.2+, Chrome all these text should be comment*/
-moz-transition: all 0.5s ease-out; /* FF4+ */
-ms-transition: all 0.5s ease-out; /* IE10 */
-o-transition: all 0.5s ease-out; /* Opera 10.5+ */
transition: all 0.5s ease-out;
When you hover over the image, both the image and the part where the text is is clickable. Also the part of the text highlights red, thats great. When you hover over the text, also the text background area changes to red and the text part and the image part is clickable. What I want is that when you hover over the image that the WHOLE part of the text-area and the white area under the text-area is hoverable/clickable (so that white part right next to the image, the rectangular block that has the full height of the image and the full width of the text-area). Is that possible to make the whole rectangular block hoverable/clickable (and not just that text-area block)?
.well.sb:hover {
color: #FFF;
background-color: #A10000;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.well.sb:hover div {
color:#FFF;
text-decoration:none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.well.sb {
background-color: #FFF;
text-align: left;
padding: 0;
border: none;
border-bottom: 1px solid #e3e3e3;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.article-image img {
width: 40%;
height: auto;
margin-right: 10px;
margin-top: 0px;
float:left;
}
<div class="well sb">
<div>
<a href="#">
<div class="article-image">
<img alt="#" src="http://lorempixel.com/100/100">
<div class="tag">
TAG
</div>
<div class="title">
TITLE
</div>
</div></a>
</div>
</div>
Something like this?
A solution using flexbox
.well.sb:hover {
color: #FFF;
background-color: #A10000;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.well.sb:hover div {
color: #FFF;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.well.sb {
background-color: #FFF;
text-align: left;
padding: 0;
border: none;
border-bottom: 1px solid #e3e3e3;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.well.sb a {
display: flex;
}
.well.sb .article-image {
width: 40%;
margin-right: 10px;
}
.well.sb .article-image img {
width: 100%;
height: auto;
}
<div class="well sb">
<a href="#">
<div class="article-image">
<img alt="#" src="http://lorempixel.com/100/100">
</div>
<div class="txt">
<div class="tag">
TAG
</div>
<div class="title">
TITLE
</div>
</div>
</a>
</div>
The float:left needs to be followed by a clear:both for its parent to compute the height of the floated contents. Add the following css
.article-image:after{
content: '';
clear: both;
display:block;
}
.well.sb:hover {
color: #FFF;
background-color: #A10000;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.well.sb:hover div {
color:#FFF;
text-decoration:none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.well.sb {
background-color: #FFF;
text-align: left;
padding: 0;
border: none;
border-bottom: 1px solid #e3e3e3;
text-decoration: none;
-moz-transition: .6s ease-in-out;
-webkit-transition: .6s ease-in-out;
-o-transition: .6s ease-in-out;
-ms-transition: .6s ease-in-out;
transition: .6s ease-in-out;
}
.article-image img {
width: 40%;
height: auto;
margin-right: 10px;
margin-top: 0px;
float:left;
}
.article-image:after{
content: '';
clear: both;
display:block;
}
<div class="well sb">
<div>
<a href="#">
<div class="article-image">
<img alt="#" src="http://lorempixel.com/100/100">
<div class="tag">
TAG
</div>
<div class="title">
TITLE
</div>
</div></a>
</div>
</div>
I have right side fix position div. I want to display it on hover with animation.
What I want to do that if user hover on the whole div the both span should come out with slide animation. BUT right now the scroll is coming and only one span the text(need help) coming out not ? mark coming out.
.need-help-qu{
background-color:#042E49;
color:#ffffff;
padding:0px 10px;
right:0;
top:40%;
font-weight: bold;
font-size: 20px;
position:absolute;
transition: all 0.4s ease-in-out;
-webkit-transition: all .8s ease;
-moz-transition: all .8s ease;
-ms-transition: all .8s ease;
-o-transition: all .8s ease;
transition: all .8s ease;
}
.need-help{
background-color:#06507D;
color:#ffffff;
right:-150px;
top:40%;
position:absolute;
padding:5px 10px;
display: inline-block;
overflow: hidden;
transition: all 0.4s ease-in-out;
-webkit-transition: all .8s ease;
-moz-transition: all .8s ease;
-ms-transition: all .8s ease;
-o-transition: all .8s ease;
transition: all .8s ease;
}
.need-help-full:hover .need-help {
right:0;
}
<div class="need-help-full">
<span class="need-help-qu">?</span>
<span class="need-help text-sm">NEED A HELP</span>
</div>
Check this out.
You were trying to move individual divs so it was proving tricky, just bunch the whole content of .need-help-full div together and move it as a whole.
<div class="need-help-full">
<span class="need-help-qu">?</span>
<span class="need-help text-sm">NEED A HELP</span>
</div>
<style>
.need-help-qu{
background-color:#042E49; color:#ffffff; padding:3px 10px 2px;
font-weight: bold;font-size: 20px;float:left;
}
.need-help{
float:left; background-color:#06507D; color:#ffffff;
padding:5px 10px;overflow: hidden;
}
.need-help-full{
right:-123px; position:fixed; transition: all 0.4s ease-in-out;
-webkit-transition: all .8s ease;-moz-transition: all .8s ease;
-ms-transition: all .8s ease;-o-transition: all .8s ease;
transition: all .8s ease;
}
.need-help-full:hover{right:0;}
</style>
Also I see that you are trying to accomplish this slide in box so mostly it is done using position:fixed; and not using absolute. Since it is generally "fixed" to the page and not to some container element.
You can do following way. Make parent component overflow:hidden. and move need-help-full left/right on hover and give absolute position to need-help-full div.
.need-help-qu {
background-color: #042e49;
color: #ffffff;
display: inline-block;
font-size: 20px;
font-weight: bold;
padding: 3px 10px;
vertical-align: top;
}
.need-help {
background-color: #06507d;
color: #ffffff;
display: inline-block;
overflow: hidden;
padding: 5px 10px;
right: -150px;
}
.need-help-full {
height: 50px;
overflow: hidden;
padding: 5px 10px;
position: absolute;
right: -135px;
top: 40%;
-webkit-transition: all .8s ease;
-moz-transition: all .8s ease;
-ms-transition: all .8s ease;
-o-transition: all .8s ease;
transition: all .8s ease;
}
.need-help-full:hover {
right:0;
}
body {
overflow: hidden;
}
<div class="need-help-full">
<span class="need-help-qu">?</span>
<span class="need-help text-sm">NEED A HELP</span>
</div>
Hope it helps.
$(".need-help-qu").hover(function(){
$(".need-help-qu").animate({right: '12px'});
});
body{
overflow-x:hidden;
}
.need-help-qu{
background-color:#042E49;
color:#ffffff;
padding:0px 10px;
right:0;
top:40%;
font-weight: bold;
font-size: 20px;
position:absolute;
transition: all 0.4s ease-in-out;
-webkit-transition: all .8s ease;
-moz-transition: all .8s ease;
-ms-transition: all .8s ease;
-o-transition: all .8s ease;
transition: all .8s ease;
}
.need-help{
background-color:#06507D;
color:#ffffff;
right:-150px;
top:40%;
position:absolute;
padding:5px 10px;
display: inline-block;
overflow: hidden;
transition: all 0.4s ease-in-out;
-webkit-transition: all 1s ease;
-moz-transition: all 1s ease;
-ms-transition: all 1s ease;
-o-transition: all 1s ease;
transition: all 1s ease;
}
.need-help-full:hover .need-help {
right:40px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="need-help-full">
<span class="need-help-qu">?</span>
<span class="need-help text-sm">NEED A HELP</span>
</div>
i have a problem, HTML elements are moving while animation, i have captured 2 pics to guess what i want...
Before animation:
http://i031.radikal.ru/1406/9a/41e9b81ddaed.png
After animation:
http://i057.radikal.ru/1406/1b/c5e3f763fd98.png
all i want is, that after "transition", elements stay on their line...
Here is some HTML and CSS code
HTML
<div id="sliderdiv">
<ul>
<li>
<div id="bullets">
<div class="bullet" id="bul1"></div>
<div class="bullet" id="bul2"></div>
<div class="bullet" id="bul3"></div>
<div class="bullet" id="bul4"></div>
<div class="bullet" id="bul5"></div>
</div>
</li>
<li>
<div id="sliderimages">
<img src="sliderimages/bilberry.png">
<img src="sliderimages/dogrose.png">
<img src="sliderimages/dryedbilberry.png">
<img src="sliderimages/dryeddogrose.png">
<img src="sliderimages/dryedherbs.png">
<img src="sliderimages/wildapple.png">
</div>
</li>
<li>
<div id="arrows">
<div id="slideup"></div>
<div id="slidedown"></div>
</div>
</li>
</ul>
CSS
#sliderdiv{
text-align: center;
padding-top: 40px;
height: 771px;
width: 100%;
}
#sliderimages{
overflow: hidden;
text-align: center;
height: 771px;
width: 1187px;
}
#sliderdiv ul li{
list-style: none;
display: inline-block;
}
#arrows{
width: 26px;
margin-left: 5px;
}
#slideup{
margin-bottom: 10px;
}
#slideup{
cursor: pointer;
width: 26px;
height: 18px;
background-image: url('slideup.png');
-webkit-transition: background-image 0.5s ease-in-out;
-moz-transition: background-image 0.5s ease-in-out;
-ms-transition: background-image 0.5s ease-in-out;
-o-transition: background-image 0.5s ease-in-out;
transition: background-image 0.5s ease-in-out;
}
#slideup:hover{
background-image: url('slideuph.png');
-webkit-transition: background-image 0.5s ease-in-out;
-moz-transition: background-image 0.5s ease-in-out;
-ms-transition: background-image 0.5s ease-in-out;
-o-transition: background-image 0.5s ease-in-out;
transition: background-image 0.5s ease-in-out;
}
#slidedown{
cursor: pointer;
overflow: hidden;
margin-bottom: 380px;
width: 26px;
height: 18px;
background-image: url('slidedown.png');
-webkit-transition: background-image 0.5s ease-in-out;
-moz-transition: background-image 0.5s ease-in-out;
-ms-transition: background-image 0.5s ease-in-out;
-o-transition: background-image 0.5s ease-in-out;
transition: background-image 0.5s ease-in-out;
}
#slidedown:hover{
background-image: url('slidedownh.png');
-webkit-transition: background-image 0.5s ease-in-out;
-moz-transition: background-image 0.5s ease-in-out;
-ms-transition: background-image 0.5s ease-in-out;
-o-transition: background-image 0.5s ease-in-out;
transition: background-image 0.5s ease-in-out;
}
.bullet{
position: relative;
background-color: #747474;
width: 10px;
height: 10px;
margin-bottom: 15px;
border-radius: 30px;
border: none;
-webkit-transition: background-color, border 0.2s ease-in-out;
-moz-transition: background-color, border 0.2s ease-in-out;
-ms-transition: background-color, border 0.2s ease-in-out;
-o-transition: background-color, border 0.2s ease-in-out;
transition: background-color, border 0.2s ease-in-out;
}
.bullet:last-child{
margin-bottom: 350px;
}
.bullet:hover{
border-left: 5px;
border: solid 5px #747474;
background-color: #eeeeee;
-webkit-transition: background-color, border 0.2s ease-in-out;
-moz-transition: background-color, border 0.2s ease-in-out;
-ms-transition: background-color, border 0.2s ease-in-out;
-o-transition: background-color, border 0.2s ease-in-out;
transition: background-color, border 0.2s ease-in-out;
}
.bullet:last-child:hover{
margin-bottom: 350px;
}
#bullets{
margin-right: 10px;
}
You can set initial value for border property to 5px solid #FFFFFF to .bullet selector. Assuming here color #FFFFFF is the background color of your page (so it looks transparent).
And when hovering over the bullets replace border shorthand property with single longhand property border-color: #747474; inside the pseudo selector :hover, while border-width and border-style will be inherited from the initial border value 5px and solid
DEMO
Try adding this to your classes:
.bullet{
position: relative;
}
.bullet:hover{
right: 5px;
top: -5px;
margin-bottom: 5px;
}