简体   繁体   English

更改:之前何时:hover 超过主 DIV?

[英]Change :before when :hover over main DIV?

I have a div that looks like a speech bubble.我有一个看起来像气泡的 div。 The main div is the bubble and the:before is the arrow.主 div 是气泡,而:before 是箭头。 What I want to do, is when you rollover :hover the DIV in CSS, it will also change the :before .我想要做的是,当你翻转:hover中的 DIV 时,它也会改变:before

Here's my code:这是我的代码:

.sidebar_image_box_newsfeed_user_info_comments { 
    color: #ffffff; 
    background-color: #2f2f2e;
    text-decoration: none; 
    -webkit-transition-property: background-color, color, text-decoration; 
    -webkit-transition-duration: 0.5s, 0.5s, 0.5s; 
}

.sidebar_image_box_newsfeed_user_info_comments:hover { 
    background-color: #3b3b3b; 
    color: #f3f3f3; 
    text-decoration: underline; 
}

.sidebar_image_box_newsfeed_user_info_comments:before { 
    content:""; position:absolute;
    bottom:-6px; right:0;
    border-width:0 0 6px 6px;
    border-style:solid;
    border-color:transparent #2f2f2e;
    text-decoration: none;
    -webkit-transition-property: background-color, color, text-decoration;
    -webkit-transition-duration: 0.5s, 0.5s, 0.5s;
}
.sidebar_image_box_newsfeed_user_info_comments:hover:before {
   content: "I am new";
}

jsFiddle . js小提琴

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM