How can the top height of a jquery dialog be reduced?

Just starting out with jquery, I've got a dialog box and I'm looking to decrease the height of this red image:

https://i.sstatic.net/BuyQL.png

Is there a way to do it?

I've already made changes in the jquery-ui.css code, like so:

.ui-dialog {
    position: fixed;
    top: 0;
    left: 0;
    padding: .2em;
    outline: 0;
}

/*.fixed-dialog{
  position: fixed;
  top: 50px;
  left: 50px;
}*/

/* Popup title bar */
.ui-dialog .ui-dialog-titlebar {
        padding: .1em 1em;
        border: 0;
    position: relative;
        top: -80px;
        height: 45px;
        /*width: 310px; */
        margin: 1em 0;
        font-family: Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
        border-radius: 5px 5px 5px 5px;
}
/* Popup title */
.ui-dialog .ui-dialog-title {
    float: left;
    margin: .1em 0;
    white-space: nowrap;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
        /* added */
        text-align: center;
        color: #ffffff;
}
/* Close button on top */
.ui-dialog .ui-dialog-titlebar-close {
    display: none;
        position: absolute;
    right: .3em;
    top: 170%;
    width: 21px;
    margin: -10px 0 0 0;
    padding: 1px;
    height: 20px;
        outline: none;
}
/* Popup text */
.ui-dialog .ui-dialog-content {
    position: relative;
    border: 0;
    padding: 0em 1em;
    background: none;
    overflow: auto;
}
/* Button bar */
.ui-dialog .ui-dialog-buttonpane {
        position: relative;
        text-align: left;
    border-width: 1px 0 0 0;
    margin-top: .5em;
    padding: .3em .6em .6em 1em; /* H D B G */
        outline: none;
        background: #a3cb38;
        border-radius: 5px 5px 5px 5px;
}
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset {
    /* float: right; */
        float: none !important;
        text-align:right;
}
.ui-dialog .ui-dialog-buttonpane button {
    /*margin: .5em .4em .5em 0;*/
    position: relative;
        border: 0;
        top: 3px;
        left: 15px;
        width: 100px;
        height: 45px;
        cursor: pointer;
        color: #ffffff;   /* button text color */
        outline: none;
        font-family:Montserrat,"Helvetica Neue",Helvetica,Arial,sans-serif;
        background: #fed136;   /* button background color */
        border-radius: 12px 5px 12px 5px; 
}

.ui-dialog .ui-resizable-se {
    width: 12px;
    height: 12px;
    right: -5px;
    bottom: -5px;
    background-position: 16px 16px;

The code in my html file:

$("#dialog").dialog({
                autoOpen: true,
                modal: false,
                bgiframe: true,
                draggable: true,
                height: 300,
                width: 350,
                position: 'center',
                show: {
                 effect: "fade",
                 duration: 1000
                },
                hide: {
                 effect: "fade",
                 duration: 400
                }, 
                resizable: false,
                buttons: [
                      {text: "OK", click: function () {
                      [...]
                      }

Any suggestions on how to reduce the height of this red area?

The html lines:

<header>
    <!-- popup -->
    <div id="dialog" class="pop" title="Info">
        <h3><center ">A long text here, like this one. And more.</center></h3>
        <h3><center ">Second line !</center></h3>
    </div>
</header>

My css file:

.pop.active {
    visibility: visible;
    display: block;
}
.pop.desactive {
    visibility: hidden;
    display: none;
}

Answer №1

Take out the styles top: -80px and margin: 1em 0; from the selector .ui-dialog .ui-dialog-titlebar

view this demo

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

Create a jQuery datatable row using data from an internal array

Received a JSON response from the server: { "data": [{ "id": 1, "apiKey": "test1", "name": [{ "identifier": "1", "status": "Online" }, { "identifier": "2", "status ...

CSS - setting the background-image property is not displaying the image

.main_banner { background-image: url("../images/main_banner.png"); width: 100%; height: auto; } <!DOCTYPE html> <html> <heading> <title> ********** </title> <link rel="sty ...

Generating dynamic XElements within an XDocument through iteration

Is there a way to dynamically generate 'n' number of XElements within an XDocument using a loop, based on the number of files found in a directory? The code for my work-in-progress project is quite lengthy to include here, so I have uploaded it ...

Configuring Node.js and express.js for my personal website to showcase my projects

I am new to node.js and I'm excited to implement it on my personal website as a way to start learning. I have successfully set up the node server, but I am struggling with setting up routing using express.js. All my files are typical static files like ...

Displaying various charts in a single view without the need for scrolling in HTML

How can I display the first chart larger and all subsequent charts together in one window without requiring scrolling? This will eventually be viewed on a larger screen where everything will fit perfectly. Any recommendations on how to achieve this? Here ...

The presence of an undefined variable in `esm.js` is resulting in an overwhelming amount of

After upgrading from Node v14 to Node v16, I encountered a strange error specifically when running node with node -r esm. The error message reads: ReferenceError: myVar is not defined This results in an extensive output of the esm.js module spanning 5000 ...

Update the display of the mouse pointer

I use CSS to set a custom cursor image: #scroll_up{ display: block; position: absolute; width: 960px; height: 300px; cursor: url(../imgs/cursor_up.png), auto; } The above style is assigned to a div element so that the cursor appea ...

Encountering obstacles as a novice trying to master CSS styling techniques

I'm having trouble aligning buttons at the center top of the screen. Despite my efforts, I can't seem to get them perfectly aligned https://i.stack.imgur.com/j7Bea.png button { width: 13%; height: 50px; display: inline-block; fo ...

Adding up values of objects in a different array using Vue.js

Recently, I started using VueJs and encountered an object that contains arrays. One of the tasks I need to accomplish is to display the total sum of all amounts in one of the columns of the table. Here is my table structure: < ...

Issue: My application is unable to start due to the module nuxt.js not being found. Can someone help me troubleshoot

Upon attempting to execute npm run dev following the installation of dependencies, I encountered an error that has left me puzzled. Despite trying various solutions found online, none have seemed to resolve the issue. <a href="/cdn-cgi/l/email-protectio ...

Utilizing JavaScript to verify the presence of a div element within dynamically injected HTML code

While working on a website, I have implemented an embed function which involves calling a javascript from my server to inject HTML on another remote server. To ensure that these embeds also benefit from Google ranking, I have included a piece of HTML in t ...

Solving Addition and Subtraction Errors in Javascript/Jquery

Upon running the script below, it aims to calculate the height of the browser, as well as the heights of both the header and footer, subtracting them from the initial browser height: var a = $(window).height(); alert (a); var b = $('#header').cs ...

Unable to view indicators and slides are not transitioning in Bootstrap carousel

I am in the process of developing a website with bootstrap, but I am encountering issues with the carousel feature. Despite copying the code directly from their official page, the carousel remains non-functional. The indicators are missing, and the slides ...

Incorporate action icons (such as edit and delete) into a table in React.js using material-ui

Within my existing table, I utilized a library known as react-bootstrap-table-next This library effectively displays data in a table format with values originating from a JSON response Now, my goal is to integrate an Action column that includes options f ...

What is the best way to reset form after submission in Next.js?

I have a contact form and I want all the form values to be cleared after submitting the form. I've tried the following code, but the values of the form remain unchanged after submission. What could be causing this issue and how can it be resolved? ...

How can I incorporate percentage values into input text in Angular?

How can I include a percent sign in an input field using Angular, without relying on jQuery? I am looking for a solution that is identical to what I would achieve with jQuery. Here is the current status of my project: ...

Conceal all elements until they are fully loaded

$(document).ready(function(){ setTimeout(function(){$('.preloader').fadeOut()}, 5000); }); This simple code snippet demonstrates a loading icon that fades out once the document has finished loading. You can observe this behavior on , where it gr ...

The execution of Javascript should be limited to when the tab or browser window is in focus

Similar Question: Detect If Browser Tab Has Focus I have developed a basic Java applet that is capable of capturing a client's screen. By using a small piece of JavaScript code, I can initiate the applet and capture the active screen image. Howe ...

A step-by-step guide on showcasing freshly submitted input data through Ajax

I'm having trouble with this issue! Once I submit the new input, it doesn't show up in the div. Below is my JavaScript code: $('#addVariable').validate({ rules: { variable: {required:true}} , submitHandler: functio ...