Tips for minimizing the width of a dropdown menu

I am currently working on a website project and have encountered an issue with the dropdown menu. I am using a template for the website where the dropdown menu is set to full width. However, I would like to reduce the width of the dropdown menu to match the size of the main heading box. Below is the code snippet from the display page along with the CSS script used in the HTML page. Can someone please assist me in adjusting the width of the dropdown menu?

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Menu</title>
    <link href="ddmenu/ddmenu.css" rel="stylesheet" type="text/css" />
    <script src="ddmenu/ddmenu.js" type="text/javascript"></script>
    <style>
        /*The following styles are specific to this demo page only (not required for the ddmenu).*/
        body { background: #eee url(loginpage1.jpg) no-repeat center 0px; padding-top:90px;}
    </style>
</head>
<body>
<nav id="ddmenu">

    <ul>
        <li class="full-width">
            <span class="top-heading">bguge</span>
            <i class="caret"></i>
            <div class="dropdown">
                <div class="dd-inner">
                    <ul class="column">
                        <li><h3>hwehwieo</h3></li>
                        <li><a href='hgh.php'>gnehgiwe</a></li>
                        <li><a href='disuests.php'>ghgowgh</a></li>
                    </ul>

                </div>
            </div>
        </li>
    <!-- More list items here --!>
          <li class="full-width">
           <li><a href="index.php">LOGOUT</a></li>
        </li>
    </ul>
</nav>
</body>
</html>

Answer №1

#main-menu .full-width .dropdown {
    width:50%; // adjust the width as needed.
    padding:0;
    margin:0;
}

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

Is there a way to position two <div> elements side by side so that they are the same width and height without causing any scrolling?

I am in the process of creating a basic HTML page with two sections, each containing content. However, the last content within the second .right div is extending to the bottom of the page, causing it to become scrollable. I attempted to create another div ...

Striking new design for bootstrap 3 datepicker with a unique custom theme - stunning appearance

After purchasing a custom Metro theme from the John Papa AngularJS/Breeze courses on Pluralsight, everything was running smoothly until I attempted to integrate a Bootstrap 3 date picker into the mix. Unfortunately, right off the bat, it looked quite messy ...

Is there a way to create a function in JavaScript that can iterate through all node elements within a node collection?

Trying to ask a question in English when only having half knowledge of the language can be quite confusing. Therefore, I aim to create a function that can differentiate between a single node or a collection of nodes as its parameter and then retrieve the d ...

Exploring Vue's data binding with both familiar and mysterious input values

How can I model an object in Vue that contains both known and unknown values? The quantity is unknown, but the type is known. I need to present user inputs for each type, where the user enters the quantity. How should I approach this? data() { retur ...

After submitting the form, I must only deactivate the checkbox that has been selected

Here is the HTML code I am working with: I have multiple checkboxes designed as buttons to select a room, but it's quite annoying when they all get selected at once. $("form").submit(function() { $('.seat input:checkbox').prop("disable ...

Encountering an issue with Angular routing: Cross-origin requests are restricted to specific protocol schemes, such as HTTP

I encountered an error while working on angular routing. Below is my HTML code snippet: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <script src= ...

How can Django display HTML content verbatim without needing a variable?

I have a collection of HTML code: <div align="center" id="whatever"> <a href="http://www.whatever.com" style="text-decoration:none;color:black"> <img src="http://www.whatever.com/images/whatever.jpg" /> </a></div> I am look ...

What is the best way to split a Bootstrap col-md div in half vertically?

I am attempting to create the following layout using the Bootstrap grid system. Within a container <div class="row">, there are two divs occupying half of the width each (<div1> and <div2>). The height of <div1> will vary based on t ...

Grid functionality in Bootstrap not responsive on mobile devices

I have created a grid structure for my website using bootstrap 3. It looks great on desktop, but when I resize the window it does not switch to mobile or tablet view. What am I doing wrong? On desktop, I want each panel to take up 1/6 of the row, and on ...

Build a Container Div using DOM/XPATH techniques

I have just initialized a new DOM XPATH OBJECT. After performing several operations, I saved my result using SaveHtml $String[] = $dom->saveHTML(); Next, I placed the content into a file. file_put_contents($filename, $string); The HTML Structure l ...

Child container scrollbar covered by box-shadow

Currently, I am developing a page where on mobile devices, the navigation links need to be displayed horizontally and hidden via overflow if they are collectively too wide. To indicate to users that there are additional items to scroll through, I have adde ...

Select the even-numbered occurrences of a specific class in CSS using the nth-child()

I am encountering an issue with my table layout. The structure is similar to the following: <tbody> <tr class="row">...</tr> <tr class="row--expanded">...</tr> <tr class="row">...</ ...

Pattern matching to locate text that is not enclosed within HTML tags and does not fall within certain specified tags

I am attempting to create a regular expression that will match specific words located outside and between HTML tags (but not within the tags themselves). However, I also need to ensure that these words are excluded when they appear between heading tags suc ...

In responsive design, the sidebar may be positioned either above or below the content, depending

Managing the placement of a sidebar in a responsive design can be tricky, especially when the sidebar content is crucial on some pages but not on others. One solution may involve switching the order of div elements in the HTML code, but this approach might ...

The .val() function in jQuery can sometimes give different results when used on input elements with placeholder text in Firefox compared to Chrome

After analyzing the given HTML code, I've noticed discrepancies in the values returned by jQuery in Firefox and Chrome: HTML: <input type="text" name="name" id="name" placeholder="Type Here"> <input type="email" name="email" id="email" plac ...

The <div> element is not compatible with the <canvas> element for use

I'm having trouble inserting a <canvas> animation within a <div> element. The current code displays the animation across the entire page, but I would like to contain it within a single section, like this: <div><canvas> </can ...

Changing the visual appearance of an alert in JavaScript and HTML

My knowledge in JavaScript is limited, but I have a script that retrieves a query from a Python service to a Mongodb database. The query is returned in the following format: [{CHAIN: "STREET ELM, ELMER", CODE: "1234"}, {CHAIN: "STREET LM, LMAO", CODE: ...

"When using Webpack and Sass, the background image specified with background: url() is processed correctly. However, when using webpack-dev-server, the image is

Currently, I am utilizing Webpack 2 in conjunction with webpack-dev-server and Sass loader. Here is my current configuration: { test: /\.scss/, loaders: [ "style", { loader: "css", query: { modules: false, sourceMap: true } }, ...

What seems to be the issue with Collapse.js in Bootstrap 3.3.4 on this page?

I am currently utilizing Bootstrap version 3.3.4. All of my resources are linked relatively and the HTML file is in the correct location for access. I am creating a 'Learn More' button that should display a collapsed unordered list either above ...

show a feature through exporting in a react component

I'm currently learning React by tackling a problem in React. Below is the React code challenge I'm working on. However, I encountered an error in the browser that I couldn't resolve even after searching on Google. I've included my code ...