Skip to main content

Hover Bullet Points --> Making it Different


gstager
Hero III
Forum|alt.badge.img+7

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!

Did this post help you find an answer to your question?

11 replies

lrnlab
Hero III
Forum|alt.badge.img+8
  • Hero III
  • 4854 replies
  • July 12, 2022

Love it!


Bfarkas
Hero III
Forum|alt.badge.img+5
  • Hero III
  • 3582 replies
  • July 12, 2022

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


dklinger
Hero III
Forum|alt.badge.img+8
  • Hero III
  • 1682 replies
  • July 13, 2022
Bfarkas wrote:

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!


gstager
Hero III
Forum|alt.badge.img+7
  • Author
  • Hero III
  • 894 replies
  • July 13, 2022
dklinger wrote:

@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.


Bfarkas
Hero III
Forum|alt.badge.img+5
  • Hero III
  • 3582 replies
  • July 13, 2022

Better than nothing!


gstager
Hero III
Forum|alt.badge.img+7
  • Author
  • Hero III
  • 894 replies
  • July 13, 2022

@Bfarkas - for sure!


check
  • Newcomer
  • 3 replies
  • July 14, 2022

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. 


gstager
Hero III
Forum|alt.badge.img+7
  • Author
  • Hero III
  • 894 replies
  • July 14, 2022

@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.

 


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


gstager
Hero III
Forum|alt.badge.img+7
  • Author
  • Hero III
  • 894 replies
  • September 19, 2022

@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.


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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings