Hover Bullet Points --> Making it Different


Userlevel 7
Badge +5

Thought I would have a little more fun with some CSS ideas.

I was thinking about how a bunch of bullet points can be really boring and what we could do to change that up a bit so here was something I thought of to make it a little more interesting.

I used a Font Awesome icon (part of Docebo) to be the new bullet and made it so when you hover over it you can read the text when the information slides out.

Of course you can modify the code however you wish for colors or the icon to suit your needs.

Here is how it turned out.

 

This has both a CSS and an HTML component.

Here is the code for exactly what you see above.

CSS

/** Tweak your width and height as desired **/
/** I chose to go small to just show the bullet **/
/** adjust colors and duration as desired **/
.hoverBox {
width: 42px;
height: 25px;
background-color: #008aab;
color: white;
transition-property: width;
transition-duration: 0.5s;
margin: 5px;
white-space: nowrap;
}


/** This is the new width when you hover **/
/** Set as desired - suggest enough for longest bullet text **/
.hoverBox:hover {
width: 200px;
}

 

HTML

<!-- This is the little Header -->
<!-- Size and style it however you wish -->
<div>
<h4 style="margin-left:5px;">Bullet Point Idea</h4>
</div>

<!-- These are the Bullets -->
<!-- Bullets are all the same, just swap out text as needed -->
<!-- Easily copy and paste another div to make additional bullets -->
<div class="hoverBox">
<p><i class="fa fa-star fa-fw" style="font-size:18px;margin-left:10px;margin-right:25px;"></i>
Bullet Point 1</p>
</div>

<div class="hoverBox">
<p><i class="fa fa-star fa-fw" style="font-size:18px;margin-left:10px;margin-right:25px;"></i>
Bullet Point 2</p>
</div>

<div class="hoverBox">
<p><i class="fa fa-star fa-fw" style="font-size:18px;margin-left:10px;margin-right:25px;"></i>
Bullet Point 3</p>
</div>

Hopefully this helps someone out!


11 replies

Userlevel 7
Badge +7

Love it!

Userlevel 7
Badge +3

I don’t think I realized font awesome was included in Docebo, use the library all the time elsewhere, sweet! Nice work as always!

Userlevel 7
Badge +6

I don’t think I realized font awesome was included in Docebo, use the library all the time elsewhere, sweet! Nice work as always!

@Bfarkas - just keep an eye on that - my understanding - it is a limited library of font awesome.

And @gstager - awesome!

Userlevel 7
Badge +5

@Bfarkas- just keep an eye on that - my understanding - it is a limited library of font awesome.

And @gstager - awesome!

Thanks, @dklinger 

Yeah - I believe its just the Font Awesome 4 library.

Userlevel 7
Badge +3

Better than nothing!

Userlevel 7
Badge +5

@Bfarkas - for sure!

Userlevel 2

This is a great idea! I added it to our sandbox and started playing around with it. Do you know if there’s a way to get the hover-over box to expand vertically? Want to see if I can use this to nest information to keep some of our dashboards tidier. 

Userlevel 7
Badge +5

@check - sure

Just change a few spots in the code above.

Change the transition-property from width to height

Change the starting width as desired.

Change the hover property from width to height

Set the hover height value as desired

Let me know if you have any other questions about this.

You might also be interested in the accordion option as well although it is a bit more complex.

 

Userlevel 2

Hi @gstager, I am trying to replicate the HTML box you created, but Font Awesome icons are not rendered in my instance!

This is my HTML:

<p><i class="fi fi-bs-computer"></i><a href="https://www.technogym.com/" target="_blank" rel="noreferrer noopener">Technogym website</a></p>

Any idea why it is not working? Should I summon Font Awesome icons somewhere?

Thanks!

Mauro

Userlevel 7
Badge +5

@MauroBorghesi 

My understanding is that only the Free Font Awesome 4 Icons are included with Docebo.

So you are going to be limited to something like 

<i class="fa fa-laptop"></i>

Not sure how you would get premium icons to render in Docebo.

Probably not the answer you wanted but hopefully it helps.

Userlevel 2

Thank you very much! At least, some icons are there ;)

Reply