Creating a Modern Tooltip Menu with HTML, CSS, and Bootstrap

My goal is to design a menu that opens to the right, similar to a tooltip. I have experimented with different bootstrap techniques, but I am encountering difficulties in including HTML li elements within the tooltip.

https://i.sstatic.net/mAHKS.jpg

Answer №1

To achieve this, you can utilize a small snippet of code in jquery and set the data-html attribute to true if the HTML content is intricate, like so: data-html="true". Subsequently, insert your HTML content within the tooltip as shown below:

$('.tooltip-demo.well').tooltip({
  selector: "a[rel=tooltip]"
})
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">


<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous">
</script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous">
</script>


<div class="tooltip-demo well">
  <p style="margin-bottom: 0;" class="muted">Tight pants next level keff chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A <a title="<h1><b>OH WOWOWO</b> <em>one</em> here too</h1>" data-html="true" rel="tooltip"
      href="#">really ironic</a> artisan w
  </p>
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to implement style guidelines that are associated with a model in AngularJS?

In the process of creating an application where 1-5 views along with the corresponding model and controller are sent to the client upon page load. The user navigates through each view in sequence using routing, which is functioning correctly. However, I a ...

Check if the element is located on the active tab using jQuery

I have implemented a tab system to organize a lengthy form with multiple input fields. The form consists of 4 tabs, and beneath them, there is a preview section displaying the user's selections. In this preview area, I added icons that enable users ...

Text input field with uneditable text displayed at the end

Click here to view the input field I am looking to create an input field that always displays a "%" at the end of the input. Here is what my react component looks like currently: <StyledBaseInput type="text" ...

JQuery validation inspecting which submission button is activated

How can I implement validation and determine which button the user has clicked? I have a submit button with the following HTML: <form id="form-post"> <button type="submit" id="one"> ONE </button> <button type="submit" id="two ...

redactor.js: Disable backspace functionality when cursor is at the start of a div-container

Currently, I am working with the redactor.js editor that utilizes editable div containers. A challenge I have encountered is when multiple contenteditable containers are nested; deleting content using the backspace button can inadvertently delete the entir ...

Reversing the order of input-group-addon and input in bootstrap on mobile devices

I attempted to adjust the layout of a bootstrap input-group-addon on mobile devices by using two input elements and manipulating their display and visibility properties. From a design standpoint, I achieved the desired result as the input is now positione ...

Scroll a highlighted row to the top within a scrollable table

http://jsfiddle.net/3tpqnu1v/ In my small table, I have highlighted a specific row with the "active" class. Is there a way to automatically scroll this highlighted row to the top, bottom, or center of the table? Please find below the HTML code for referen ...

Ways to verify the existence of outstanding requests (including Ajax and its derivatives) originating from the browser

When dealing with some of the websites I work on that have heavy ajax requests, my approach is to wait for the Ajax request to complete before clicking and asserting an element. Currently, I implement the following method: try { if (driver instanceof ...

How to perfectly center a modal window/div vertically on an iPad

Currently, I am using a simple modal window script that functions well on various browsers, including the iPad. However, I have encountered an issue where the modal window appears at the top of the page on the iPad. This causes it to be out of view if the ...

Error 404 - Bootstrap not found in Bower Components

I've scoured the internet and checked multiple forums, but I haven't been able to find a solution that works for me. My Node project has a specific structure: ├── app │   ├── config │   │   ├── env │   │   ...

Display two images consecutively within a single img tag

My goal is to display two images using a single <img /> tag. The first small image will be loaded and shown using the src attribute, while the second large image will be contained within the data-src attribute. Only one image will be displayed at a t ...

Utilizing Struts 2 to Manage HTTP Array Parameters through Ajax Requests

Struggling with sending array parameters to a Struts 2 action class using struts 2.1.8.1. Check out this snippet of code: public class MyAction extends ActionSupport { private String[] types; public String execute() { return SUCCESS; ...

Getting JSON data from an API using $.ajax

Currently, I am working on creating a random quote machine. To start off, I wrote the following HTML code to outline the necessary elements: <div id="quoteDisplay"> <h1 id="quote">Quote</h1> <h2 id="author">- Author</h2> ...

Left-aligned and centered - Bootstrap

I need help figuring out how to center a list of items on the page, but have them aligned left. I am using bootstrap. I want the text to be in the center of the page but aligned left. <ul class='text-center'> <li class=& ...

Is there a way for me to view the data transmitted by JQuery to php?

I have this piece of jQuery code. I am curious to see what PHP will output. How can I display that result? <html> <head> <script src="http://code.jquery.com/jquery-latest.min.js"></script> </head> <script> $.ajax({ ...

Dynamic jQuery slideshow with unique starting point

My photo collection is displayed in a list format like this: <ul class="slideshow"> <li><img src="images/slideshow/slide0.jpg" alt="" /></li> <li><img src="images/slideshow/slide1.jpg" alt="" /></li> & ...

When you add the /deep/ selector in an Angular 4 component's CSS, it applies the same style to other components. Looking for a fix?

Note: I am using css with Angular 4, not scss. To clarify further, In my number.component.css file, I have: /deep/ .mat-drawer-content{ height:100vh; } Other component.css files do not have the .mat-drawer-content class, but it is common to all views ...

jQuery is giving me trouble when trying to modify the select option. Despite my best efforts and exploring all possible solutions, I'm

My HTML code includes a select element with the id 'project-entry-form--category'. The options for this select element are loaded dynamically using AJAX. When I use console.log($('#project-entry-form--category')), jQuery returns all in ...

Highlight columns and rows when hovered over in a striped table using CSS styling

I have successfully implemented a CSS-only method for highlighting table columns on hover from a tutorial I found at https://css-tricks.com/simple-css-row-column-highlighting/ However, I am encountering an issue with applying the highlight to striped tabl ...

We're facing some technical difficulties with the form for the school project. Furthermore, I need to ensure that the answers are

Upon inspection, it seems that the HTML code is fine, but there appears to be an issue with the JavaScript. I also need to store the answers in an array, which is a task for later. <form> <fieldset> <legend>Content:</lege ...