Style the Search Box Close Icon in Divi

Written by Dan Mossop

The main header of the Divi theme includes a search icon, which brings up a site-wide search box when clicked. This search box includes a grey "cross" icon which can be used to close the search box. If you're after something other than a grey cross, here's how to style the search box close icon.

Styling the Search Box Close Icon with CSS

Here's an example of CSS code for applying different styles to the search box close icon. It sets the icon to a lighter grey, and turns it red on hover.

.et_close_search_field:after {
    color:#ccc;
}
.et_close_search_field:hover:after {
    color: red;
}

Elevate Your Divi Site with Dynamic Search Results

Bring instant, dynamic search results to your Divi pages with the Divi Search Results Module. This powerful module updates results live as users type, enhancing user engagement and streamlining the search experience on your site. Compatible with any input box for maximum flexibility.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

0 Comments

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.

We may earn a commission when you visit links on our website.