Issues have been encountered with the CSS width of a div containing a marquee element

I am working with the following CSS styles:

div.partnersheader{
    width:930px;
    height:27px;
    border-bottom:1px solid #030304;
    font-family:Bebas;
    color:#ffffff;
    font-size:15pt;
    padding:3px 0px 0px 10px;
}

div.partnerscontent{
    width:100%;
    height:127px;
    color:#ffffff;
    font-size:15pt;
    padding:3px 0px 0px 10px;
    overflow:hidden;
}

div.partnerscontent ul{
    list-style:none; margin:0px; padding:0px; overflow:hidden; width:100%;
}

div.partnerscontent li{
    float:left; margin-left:20px;
}

div.partnerscontent li img{
    filter: url(../sources/grayscale.svg#grayscale); /* Firefox 3.5+ */
    filter: gray; /* IE6-9 */
    -webkit-filter: grayscale(1); /* Google Chrome & Safari 6+ */
     -moz-transition:all 0.5s linear;
    -webkit-transition: all 0.5s linear;
    transition: all 0.5s linear;
}

div.partnerscontent li img:hover{
    filter: none;
    -webkit-filter: grayscale(0);
}

The corresponding HTML code is as follows:

    <div class="partners">
            <div class="partnersheader">
                Partnerzy
            </div>
            <div class="partnerscontent">
                <ul>
                <marquee onMouseOver="this.stop()" onMouseOut="this.start()">

<li>
<a href="http://www.cs-kontener.pl" target=_blank><img src="images/ck.png" border="0"  /></a>
</li>

<li>
<a href="https://www.facebook.com/Zajeb.Basem?fref=ts" target=_blank><img src="images/zb.png" border="0"  /></a>
</li>

<li>
<a href="https://www.facebook.com/pompeczkamp3" target=_blank><img src="images/pmp3.png" /></a>
</li>

<li>
<a href="http://www.facebook.com/PozitiveSound" target=_blank><img src="images/pozitiw.png" /></a>
</li>

<li>
<a href="http://www.club-sound.pl/" target=_blank><img src="images/clubsound.png" /></a>
</li>               </marquee>
                </ul>
            </div>
        </div>

In the partnerscontent, images are displayed with a marquee effect. Currently, only three images are visible in a line and the rest move to the next line. The desired layout is for all images to stay on one line like this:

1 2 3 4 5 6 7

But currently, it looks like:

1 2 3

4 5 6

7 8 9

I believe the issue is related to the width setting but I am unable to resolve it. Can someone provide assistance?

Answer №1

To effectively adjust the width of your UL element, you must first calculate and sum up the widths of all your LI elements in pixels. Avoid using a percentage value such as 100% as it may not provide the desired result. Additionally, ensure that the container surrounding the UL has the CSS property overflow: hidden to contain any overflow if the list is wider than the container.

This suggestion is based on assumptions since the HTML code has not been provided for reference.

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

I'm curious, who's in charge of determining the height and width in Chrome dev-tools?

There are moments when I feel overwhelmed, struggling to identify the culprit behind certain property values in elements. It can be quite a challenge to pinpoint the source of the issue. Does anyone have any tips for approaching a situation where you arri ...

Prevent list item from triggering onclick event while scrolling

I'm having an issue with a scrolling unordered list in an HTML5 app on a touchscreen device. When a user scrolls and then releases their finger from the list, it clicks the element they used to scroll. Is there a way to modify the onclick behavior so ...

What is the method for obtaining the image alt attribute using JavaScript?

I can't seem to retrieve the image alt tag using JavaScript. Is it even possible and if so, how should I go about it? Perhaps something like this: $caption.text( flkty.selectedElement ).attr('alt') (last line of JavaScript) But I'm st ...

One side of the page has a contrasting background color compared to the other

Is it possible to create a fixed-width layout with different background colors on either side of the page, where the background colors extend infinitely regardless of how far you zoom out? Creating a 9000x10 px image would not achieve this effect as it wou ...

Revamping the pre-existing css of Firefox 11

Is there a way to remove the 8px margin from the body tag? I've attempted a few different solutions: * { padding:0; margin:0; } as well as html, body { padding:0; margin:0 !important; } and body { margin:-8px; } and even <body style="m ...

"Is there a way to reverse the action of $( "button" ).remove()

Currently, I have implemented JQuery's $( ".button" ).remove(); function to get rid of all the buttons on my webpage immediately after a user clicks the print PDF button that changes the HTML page into a PDF. Nevertheless, once this process is done ...

Utilizing Bootstrap for center-aligning a dropdown menu

I am using bootstrap to create a dropdown menu that I want to appear as a small box in the center of the page, similar to this example. Here is the HTML code I am working with: <div class="dropdown"> <button class="btn btn-default dropdown- ...

Using base64 encoding for font-face with alternative fallbacks

After reading this article, I am interested in incorporating a font face in the following way: @font-face { font-family: 'MyWebFont'; src: url('webfont.eot'); src: url('webfont.eot?#iefix') format('embedded-openty ...

What is the best way to determine if a value is missing in JavaScript and then stop the function while displaying an

I am currently working on designing a website and I am in need of a specific function that will halt if one input value is missing and then display an error message accordingly. Below is the HTML code for the form I am working on: <form action="htt ...

Siblings selectors within Internet Explorer slow down significantly when using the :hover pseudo-class

Sample page: http://jsfiddle.net/y2pwqch6/6/ This particular example showcases a CSS selector known as the adjacent sibling selector: .l:hover + .r { color: blue } The issue arises when hovering over any element on the page, causing Internet Explore ...

Tips for aligning buttons vertically within the form-row class in Bootstrap 4

I'm facing an issue where I cannot get a set of buttons in line with labels when using different column widths in Bootstrap. The behavior of a button assigned to a specific column width, like col-3, is not the same as a button assigned with automatic ...

jQuery, the magical tool that can make forms disappear and reappear in a blink

As the heading suggests, here is the code I attempted. The forms are designed to be displayed one after the other, with each subsequent form's appearance being determined by the information provided in the previous forms. $(document).ready(function() ...

Please include text beneath the input group addon class

Hey everyone, I'm facing some issues with my layout. Whenever the input fields are empty or null, I encounter errors. I want to ensure that the input text and input group addon have equal heights. Also, upon clicking the submit button, I use jquery/aj ...

Drop down feature with interactive tool tips for dynamic values

While buttons and other HTML components with unique design tooltips are working fine, implementing them on dynamic dropdowns or simple components seems to strip away the design. Here is an example: <link rel="stylesheet" href="https://maxcdn.bootstrapc ...

What is the best way to adjust the padding during a scaling transformation?

Currently, I am working on a scaling transform where the origin is centered horizontally. However, I have noticed that when I scale the element, the vertical padding appears to be scaled, but the horizontal padding remains unchanged. How can I ensure that ...

Easy Steps to Update Label Text with jQuery

This is a div element <div> <label>some text 1</label> <label>another text 1</label> </div> <button>button</button> Each time the button is clicked, a new div tag will be added. The digit in the lab ...

Adjusting the border size of an SVG without using the viewbox

Currently, I am working with 2 SVGs where one has a viewbox and the other doesn't. They both are set to be 100% width of the parent element. The first SVG scales according to its viewbox while the second one scales according to the height of the paren ...

The responsive menu refuses to appear

my code is located below Link to my CodePen project I'm specifically focusing on the mobile view of the website. Please resize your screen until you see the layout that I'm referring to. I suspect there might be an issue with my JavaScript cod ...

Identifying collisions or contact between HTML elements with Angular 4

I've encountered an issue that I could use some help with. I am implementing CSS animations to move p elements horizontally inside a div at varying speeds. My goal is for them to change direction once they come into contact with each other. Any sugges ...

Creating Sleek Tables - comparing the benefits of using table-layout:fixed versus setting individual td-width to

Several weeks ago I posted a query (Table overflows parent div when td content is too wide) related to table design. The response I received seemed to resolve the issue perfectly. Now, as I attempted to redesign the table yesterday, I encountered a challen ...