Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change background-color on hover bulma dropdown

Tags:

html

css

bulma

I'm trying to change the background-color and color of a dropdown element of Bulma.io.

The problem is than no matter what I do it either changes the whole dropdown (also the bottom elements) or it changes only the background of the text (docs) and not the whole box.

I need to change the white box. I prepared as jsfiddle as example https://jsfiddle.net/agyfL3ae/2/ You will have to enlarge your window a lot as it's hidden on desktop

I've tried the following:

/* This changes also the elements below*/

.navbar-item :hover{
    background-color:red !important;
}

/* This changes only the text */

.navbar-link :hover{
    background-color:yellow;
}

Pretty much this is the box I need to change: https://i.snag.gy/pQyME2.jpg

like image 805
Costantin Avatar asked Oct 28 '25 21:10

Costantin


1 Answers

You can read more about the Space in selectors here

Basically, that space tells the interpreter to add that background on hover for the children of .navbar-item

Instead, you should write:

.navbar-item:hover
like image 67
Victor Avatar answered Oct 31 '25 11:10

Victor