nikki1 Posted February 22, 2021 Share Posted February 22, 2021 Site URL: https://www.blushwild.com/new-home I'm currently using a Ghost plugin to turn a button into an underline on hover. I'd like to reverse the code, so it shows with an underline and turns into a button on hover. Site is currently under dev. Can anyone help? https://www.ghostplugins.com/steps/hs83kjn7?fbclid=IwAR1D9F5poHzsqnwr31mzFdHljLx4nExFk76HgU82UfjvdhaEyVUZYcQWTGg .sqs-block-button-element--small { position:relative; height: 60px; line-height: 60px; text-align: center; transition: 0.5s; padding: 0 20px; cursor: pointer; -webkit-transition:0.5s; } .sqs-block-button-element--small:hover { background-color: transparent; border-color: transparent; color: #000000; } .sqs-block-button-element--small:hover:before{ transition-delay: .2s; } .sqs-block-button-element--small::before{ width: 0%; height:100%; z-index: 3; content:''; position: absolute; bottom:-1px; left:0; box-sizing: border-box; transition: .2s; } .sqs-block-button-element--small:hover::before { width: 100% !important; transition: .7s; } .sqs-block-button-element--small::before { border-bottom: 1px solid #000000; } Link to comment
tuanphan Posted February 28, 2021 Share Posted February 28, 2021 Hi. Remove your code & add new code /* Button underline to hover background */ a.sqs-block-button-element--small.sqs-block-button-element { background: transparent; color: black; position: relative; } a.sqs-block-button-element--small.sqs-block-button-element:after { content: ""; background: black; position: absolute; bottom: 0; width: 100%; height: 1px; left: 0; transition: all 0.5s; } a.sqs-block-button-element--small.sqs-block-button-element:hover:after { height: 100%; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.