Troubleshooting Problem with Accordion Size in CSS

I am facing an issue with a dropdown menu that I have created. The dropdown has parent and child rows to display controls, but the width of the Accordion is not stretching as expected despite being set to 100%. Using Chrome and Edge developer tools, I inspected the HTML elements to identify what might be causing this restriction on the width of my rows.

On my SharePoint page, the dropdown appears only halfway stretched across the page instead of occupying the full width. You can see how it looks currently in the following image: https://i.stack.imgur.com/JQfyl.png

To further illustrate the issue, here is a test case on JSFiddle: https://jsfiddle.net/tb36jsew/2/

$(document).ready(function(){
    $('.retro').accordion();
  
});
.ui.styled.accordion .accordion .title, .ui.styled.accordion .title {
  color: black;
  background-color: #eee;
  cursor: pointer;
  padding: 18px;
  width: 200%;
  height: auto;
  border: none;
  text-align: left;
  outline: none;
  font-size: 15px;
  transition: 0.5s;
}
.title{
  width: 200%;
  height: auto;
}
.title.drop{
  width: 100%;
}
.content{
  width: 100%;
  height: auto;
}
.ui.styled.accordion {
  width: 200%;
  height: auto;
}
.ui.stackable.grid.container.retro{
  width: 200%;
  height: auto;
}
.one.column.row{
  width: 200%
  height: auto;
}
.ui.styled.accordion .accordion .title, .ui.styled.accordion .title:hover {
    color: #f2711c;
}
a.previous {
  text-decoration: none;
  display: inline-block;
  padding: 8px 16px;
}
a:link, a:visited {
    color: #b3ab7d;
}
a.previous:hover {
  background-color: #104723;
  color: #b3ab7d;
}
.backbtn{
  padding-left: 0px; 
  padding-top: 10px;
}
.previous {
  background-color: #104723;
  color: #b3ab7d;
  text-decoration: none;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<!-- More code follows -->


<div class="backbtn">
<a href="/cyber/controls.aspx" class="previous">&laquo; Go Back</a>
</div>

Answer №1

To start, make sure to include a closing div tag before the .backbtn element in your HTML code.

      </div>
    <div class="backbtn">

Next, in your CSS:

  • Include width: auto; in the
    .ui.styled.accordion .accordion .title, .ui.styled.accordion .title
    section
  • Delete any instances of width: 200; height: auto
  • Most importantly, add the following snippet at the end of your CSS file
.ui.styled.accordion{
  width: auto !important;
}

This is necessary to override Semantic UI's default styles.

Check out the Fiddle for reference: https://jsfiddle.net/yvbenitah/sg06x4rc/4/

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

Utilize jQuery to style the background of the webpage, while excluding the Modal element when using Bootstrap

I'm currently working on implementing foggy.js () to create a blurred background effect for Bootstrap's Modal. While I've successfully blurred all elements in the background, the Modal Popup itself is also appearing blurry. So my question is ...

Select an image based on the input value provided

I'm new to coding and I'm attempting to replicate the search functionality of icomoon where typing a word displays related images. However, I'm facing an issue where I can't seem to get the value entered in the input field to trigger an ...

Tips for disabling the .on('click') function on a link within a table row

I am working with a table where clicking on a row's textboxes and buttons hide its labels and show the corresponding elements. Recently, I added a link in the last column that needs to function independently without triggering the row into "edit" mode ...

Bypass ajax request with the use of a returned promise

I've come across a scenario where I have a function within a class that is designed to return a promise for deleting an item. Here's what the function looks like: function Delete(){ // if(this.id == ""){ // return ?; // } ...

What is the best way to make my div equal in height to its preceding div sibling?

I want my new div to match the height of the previous one. I'm using percentages for width and height to ensure it displays properly on mobile devices as well. I've tried setting the parent elements to 100% width and height based on suggestions f ...

ExpressJS: Elevating Bread to New Heights

I've been struggling with adding a toast using expressjs. I attempted to use the npm package "toastr" but encountered an error stating that $.extend is not a function. In an attempt to resolve this, I replaced it with Object.assign but still couldn&ap ...

Utilize button element with both href and onClick attributes simultaneously

I'm in the process of preparing a button that includes href and onClick. After testing it on my local environment, everything seems to be working smoothly. Do you know of any specific browsers that may encounter issues with this setup? <Button cl ...

Bringing a JavaScript function into a TypeScript file results in it being treated as a namespace

Trying to bring a vanilla JavaScript function into a TypeScript file within a React Native app has presented some challenges. The import process goes smoothly when working with JS, but switching to TS triggers the error message: Cannot use namespace &apos ...

The concept of dynamic inheritance within Struts2's Tiles plugin adds a new

I am currently utilizing the Struts2 framework in conjunction with the tiles 2.0.6 plugin for my web application. Within my webapp, there is a primary "base" layout that comprises of a header, a footer, and the main page content: <definition name="shar ...

Issue "Excessive large sharp variable amount" encountered during ajax request

I'm attempting to retrieve data from a different domain using jQuery. Take a look at the code snippet below: $.ajax({ type: "GET", dataType: "script", url: "http://www.example.com/ajax.php", data: 'id=5', success: functi ...

How to retrieve the filename from a URL using Node.js

In my Node.js script, I have the following type of link: 148414929_307508464041827_8013797938118488137_n.mp4.m4a?_nc_ht=scontent-mxp1-1.cdninstagram.com&_nc_ohc=_--i1eVUUXoAX9lJQ-u&ccb=7-4&oe=60835C8D&oh=61973532a48cb4fb62ac6711e7eba82f& ...

Converting a JavaScript hash into a single object: A step-by-step guide

I have an array of objects in the following format: var log=[ { billkey:"Name", billvalue:"ABC" }, { billkey:"Department", billvalue:"Computer" }]; and I want to convert it into a single object like this: var log={ "Name":"ABC", " ...

Utilize a component's CSS styles by inheriting them and applying them to another component

I have created custom styles for an object as shown below: form#sign_in{ position:relative; margin:85px auto 50px auto; width:455px; background:#fff; border:#dfdfdf 1px solid; border-radius:5px; -moz-border-radius:5px; -web ...

When using node.js and express, attempting to send an email with the packages 'nodemailer' and 'nodemailer-handlebars' may result in a TypeError being thrown, specifically [ERR_INVALID_ARG_TYPE]

I am encountering an issue while attempting to send an email using an HTML template located in the 'view' folder within the same path. The HTML template is named 'index.handlebars'. Despite believing that the path is correct, I am recei ...

Executing an event in Javascript or triggering with Jquery- the process of initiating an event once a value is sent to an input box by Javascript

How do you trigger an event when a JavaScript-passed value is entered into an input box? <!DOCTYPE html> <html> <body> <p>Type something in the text field to activate a function.</p> <input type="text" id="myInput" oninp ...

Utilizing JSX within this.state results in it being displayed as plain text when rendered

Currently, I am dynamically rendering a list of elements and I need to insert other elements in front of them based on key-value pairs. I want to utilize <sup></sup> tags for these elements, but they are appearing as plain text rather than sup ...

Deleting a button from a list item or array in Angular 12

Having some trouble removing a list item with the click button, I've tried a few options but nothing seems to be working. Can anyone offer assistance? I need to remove a list item from my users array when clicked. Below is the Typescript code and cor ...

Choosing various data using Ajax

I am currently in the process of extracting various pieces of data from my insert.php page, including the post id, username, and user id. I intend to include other selected data as well. However, when trying to echo out multiple queries, all the informatio ...

Avoiding the sudden appearance of unstyled content in Single-File Components

I am looking to update my HTML navigation <div id="header-wrapper"> <div id="header-logo-title"> <nav> <ul id='mainNav'> <li>Home</li> </ul> </nav> ...

Issue with jQuery AJAX call: When submitting an HTML form, control is not being returned to the calling

I am facing an issue with my HTML form where it is loaded correctly into the DOM through a jQuery ajax call. The problem arises when I submit the form data to a PHP module using another jQuery ajax call. Even though the network traffic shows that the form ...