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:

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

Tips on enhancing an array by separating values with vertical bars instead of commas

I am trying to store checked values in an array and separate them with vertical bars instead of commas. Is there a way to achieve this using the jQuery map .get() function? Any suggestions or links you can provide would be greatly appreciated. Thank you in ...

Reveal the inner workings of functions within the Vuex Plugin

I am currently working on setting up a Vuex plugin where I want to make the undo function accessible for use in my component's click events. // plugin.js const timeTravel = store => { // .. other things function undo () { store.commit(&a ...

Seeking assistance with basic Javascript/Jquery for Ajax on Rails 3 - can anyone help?

I've been diving into JavaScript and hit a roadblock. At the moment, I have a very basic gallery/image application. My goal is to create a functionality where clicking on an image will lead the user to a URL stored in my model data using AJAX. Additi ...

The error "TypeError: b.toLowerCase is not a function in the bootstrap typeahead plugin" indicates that

Currently, I am working on implementing autocomplete search using the typeahead plugin version 3.1.1. My implementation involves PHP, MySQL, AJAX, and JavaScript/jQuery. While everything works perfectly with mysqli in terms of displaying suggestions when t ...

Conceal a division on a webpage according to the URL of the specific

<script> function hideSearchField() { if (/menu/.test(window.location.href)) { document.getElementById('searchfield').style.display = 'none'; } } hideSearchField(); </script> I am trying to accomplish this using Jav ...

Is there a different method similar to Textfield onChange that works like the HTML onChange attribute?

In my current setup, I have a Textfield component nested within other components where I pass a function pointer down to it as a prop. The challenge I'm facing is that the function responsible for passing the contents of the Textfield back up to the r ...

Issues with jQuery animate.css functionality specifically occurring on Firefox browser

As a beginner in jQuery, I have been exploring different animations and recently came across an issue with Firefox compatibility. I discovered the animate.css library, and decided to incorporate its animations into text captions on a slider using the Soli ...

Using JavaScript to invoke Applescript commands

Is it feasible to execute Applescript from JavaScript? I would be grateful if someone could offer a sample code or useful reference link. ...

What is the best way to responsively center an after pseudo-element above its parent?

Looking to create a dynamic tooltip without any fixed widths or constraints on the parent element. The process seems simple enough, but I'm facing an issue with centering the after element due to an existing transform attribute of transform: translat ...

Using `babel/register` does not seem to be functioning as expected

I am working on an isomorphic app built in ES6 on the client side using the Babel transpiler. I would like my express server to also utilize the same ES6 syntax as the client code. Unfortunately, attempting to use require('babel/register') has n ...

What is the best way to trigger a snackbar notification when two passwords do not match?

I'm currently developing a full stack application and I am facing an issue with displaying a snackbar in my signup component when the user's password and confirm password do not match. I have been advised to pass the setOpenAlert method as props ...

Angular HttpClient does not support cross-domain POST requests, unlike jQuery which does

I am transitioning to Angular 13 and I want to switch from using jQuery.ajax to HttpClient. The jquery code below is currently functional: function asyncAjax(url: any){ return new Promise(function(resolve, reject) { $.ajax({ type: ...

How can one ensure in Watin that the form is processed by the server before proceeding?

Currently, I am utilizing JavaScript to submit a form to my server within the view in order to initiate a server-side job. The completion of this job is detected by a JavaScript callback function being invoked. Although the specifics of the JavaScript comm ...

The controller is unable to accept JSON data from the JQuery.ajax function

I have thoroughly checked my web.xml and spring-servlet.xml files, but I couldn't find any issues. I then reviewed my Controller and .ajax() call, but still couldn't identify the problem. I experimented with using JSON.stringify, @RequestParam, a ...

What is the best way to conceal a menu that automatically scrolls to the content when it is clicked?

Below is a Codepen with a menu that isn't behaving as expected. var menu = document.querySelector('.nav__list'); var burger = document.querySelector('.burger'); var doc = $(document); var l = $('.scrolly'); var panel = $ ...

Do we need to use the render method in ReactJs?

I'm curious about how ReactJs uses its Render() functionality. Let's say we have some HTML code within index.html: <section id="Hello"> <h1>Hello world</h1> <p>Something something Darkside</p> </section&g ...

Is Nextjs prone to creating identical pages during the build process?

I have a question that I couldn't find the answer to anywhere, so I hope someone here can help me. I have a blog and I want to use SSG for the homepage and ISR for individual posts. If I set up my homepage using SSG to display 10 posts like this: ind ...

Challenges arise when trying to combine Bootstrap's form submit method with a jQuery plugin

I am facing an issue with my bootstrap form and a button that submits data using method=post. I also have a jquery plugin that validates the form using $('#myform').formValidation. Individually, both the button and plugin work fine. However, whe ...

Tips for concealing a field within a form using jQuery

I've been working on a script to hide an input field that I want to load dynamically with other form fields. To assist me in this process, I created a small module. /** * Implements hook_form_alter(). */ function editorhide_form_alter(&$form,$f ...

Having Trouble Showing Loading Component on Next.js v13

Having some issues with setting up a loading component in my Next.js v13 project. I followed the documentation by creating a file called loading.tsx in the src directory, but it's not appearing on the page as expected. I've also included a functi ...