Expand the width of the pop-up box

My current challenge involves displaying a popover when hovering over an element. One issue I am facing is adjusting the size of the popover box to be larger.

To see an example, check out this Plunker

I attempted to modify the width using the following CSS:

.popover-inner {
    width: 400px;
}
.popover-content {
    width: 500px;
}

Unfortunately, these changes did not have the desired outcome.

Answer №1

It appears that the issue with your code lies in attempting to modify an element without the correct selector, specifically .popover. The correct selector has a max-width property which prevents it from being edited as desired. To solve this, simply add the following CSS:

.popover {
     max-width: 500px;

That should resolve the issue.

Upon reviewing your plnkr, I noticed that you were using modal classes in the code, which is incorrect. This is not an issue related to grammar or CSS usage. To address this, I have added new CSS classes:

.popover-content > .header {
    padding: 15px;
    border-bottom: 1px solid #e5e5e5; 
}
.popover-content > .body {
    padding: 20px;
}

I have also made changes to the popover.html file:

<div class="header">
    <b>How is this amount calculated?</b>
</div>
<div class="body">
    <h4>PQ * A% * CR AVG </h4>
    <br />
    PQ - Pre-Qualified based on your historical data <br />
    A% - Approval percentage <br />
    CR AVG - (Historical Credits Earned) / (Total Certificates)
</div>
http://angular-ui.github.io/bootstrap/

You can view my updated plnkr fork here: https://plnkr.co/edit/p4dr2XMzQqw8R6RYOsMo?p=preview

Answer №2

Give this a try:

.popover-inner {
   width: 500px !important;
   max-width:500px !important;
}
.popover {
   width: 500px !important;
   max-width:500px !important;
}

This code makes use of the special !important exception to enforce the style.

When an important rule is applied to a style declaration, it takes precedence over any other declarations.

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

Managing click and double-click events on a single element using AngularJS

Struggling to handle single and double-click events in AngularJS? You're not alone. While AngularJS typically only triggers the ng-click event, even if a ng-dblclick directive is present, there's a workaround that might just do the trick: Check ...

Executing multiple functions with onPress in React Native

When I press onPress using TouchableOpacity, I am attempting to invoke multiple functions. Here's an example: functionOne(){ // perform an action } functionTwo(){ // execute something } <TouchableHighlight onPress{() => this.functionOne()}/& ...

Methods for sending emails using nodemailer

I've been attempting to send a basic email from my website to another account of mine, but I'm encountering issues. Despite closely following the documentation for node mailer, it's not functioning as expected. I've thoroughly checked ...

Sending modified ng-repeat data to a separate array when a checkbox is clicked

<div class="row"> <div class="col-md-4"> <div class="form-group"> <label class="control-label" for="SubCenter">SubCenter <span class="error">*</span></label> <span ng-init="GetSubCenter()"></ ...

Assign a unique variable to each div simultaneously

I am looking to implement a countdown feature for each DIV with the class (.topitembox) by incorporating specific JSON variables. $('#countdown_items .topitembox').each(function () { itmID = $(this).attr('class').replace(/[^0-9]/g, ...

Converting Numbers into Words with the power of HTML and JavaScript

CONVERT NUMBER TO WORDS Write a simple JavaScript program that converts a number to words. Include an HTML page where the user can input the number to be converted. The conversion process should involve using both for loops and switch statements. ...

Steps for Displaying Error Message when Search Result is Not Found in a JavaScript Table

After creating a table using HTML to display student data like name, degree, and profession, I added a search bar for users to find information on a specific student by typing the student's name. If the student is not in the table, a message "Result n ...

React.js Issue "Adjacent JSX elements need to be enclosed within a single wrapping tag"

I'm working with the following code in react.js and encountering an issue. The error message states "Adjacent JSX elements must be wrapped in an enclosing tag". It seems like React doesn't accept identical tags one after the other. How can I pro ...

I am encountering a situation while performing a Delete Jquery Ajax request where the response code is 200, however, the data is not being successfully deleted. What are some potential explanations for this issue?

Having issues with a DELETE request in my code. Here is what I have so far: $.ajax({ type : "DELETE", url : "/meds/dme-rest-api/resources/data-setup/deleteCheckList.json?" + $.param({"checkListId":currentCheckListId}), headers : {authToken : ...

Employing the $(this) in jQuery to modify a separate element

Hey, I have a question about changing attributes in jQuery. I already know how to change an attribute for the same element you hover over... $(".click2play").mouseover(function() { $(this).css({'visibility' : 'hidd ...

The usage of an import statement is not permissible outside of a module

Having some trouble using the mathjs library to calculate complex solutions for the quadratic equation. No matter how I try to import the library into my code, I keep encountering errors. Initially, I attempted this method: At the top of my root.js file, ...

Tips for modifying HTML attributes in AngularJS

I am looking to modify an attribute of a div using AngularJS. While I am familiar with how to do this in jQuery, I am not sure how to achieve it in Angular. Here is the HTML code: <div ng-app="test"> <div ng-controller="cont"> < ...

Trouble Integrating JQuery UI DatePicker into Bootstrap Card

I've built a Bootstrap 4 website with various survey questions grouped in Bootstrap Cards. One question requires a Date response, so I've implemented a JQuery-UI DatePicker for that purpose. However, upon selection, the DatePicker doesn't sh ...

What is the best way to utilize AJAX to upload several images in PHP?

I have a UI that looks like this: https://i.sstatic.net/BAbwP.jpg I am trying to upload multiple videos using ajax in PHP. I attempted to use FormData() in jQuery for this purpose. However, it seems to only upload one image and not more than that. Her ...

sending JSON data along with functions through AJAX

I am looking to rejuvenate functions that are passed through AJAX, like below: //AJAX response: {"foo":"bar","baz":"function(){console.log('I am back working as a function!');}"} It's important that baz is treated as a function and not a s ...

Purge precise LocalStorage data in HTML/JavaScript

How can a specific item in the localStorage be cleared using javascript within an html file? localStorage.setItem("one"); localStorage.setItem("two"); //What is the method to clear only "one" ...

An unexpected error occurs when attempting to invoke the arrow function of a child class within an abstract parent class in Typescript

Here is a snippet of code that I'm working on. In my child class, I need to use an arrow function called hello(). When I try calling the.greeting() in the parent class constructor, I encounter an error: index.ts:29 Uncaught TypeError: this.hello is ...

Angular service for making HTTP requests

service creation myApp.factory('customService', ['$http', function(http) { http.get($scope.url).then(function(result){ customVariable = result; } return customVariable; } Controller function appCtrl($scope, customService){ ...

The function putImageData does not have the capability to render images on the canvas

After breaking down the tileset The tiles still refuse to appear on the <canvas>, although I can see that they are stored in the tileData[] array because it outputs ImageData in the console.log(tileData[1]). $(document).ready(function () { var til ...

Utilizing Prisma's Create Object to Store Return String from Imported Function in Database

In my application, I am utilizing Typescript and have created a test to populate a database using Prisma ORM. Within this test, there is a function that returns a string: const mappingPayload = (data: any) => { let pay = [] const payload = data[0] // ...