Determining the widths of elements when floated in Opera 11.*

I'm currently facing an issue with the Opera 11.5 beta (although I suspect this applies to all Opera 11 versions) where a floated block-level element (an unordered list) is being assigned a random fixed width, causing the child elements to wrap - similar to how IE6 behaves.

The element in question is floated to the right and has no sibling elements at the moment. There are no specific widths defined for lists in my stylesheet.

I am curious about the logic that Opera employs to calculate the width under these circumstances.

I have included an image comparing Opera 11.5 to Firefox 4.1 along with Dragonfly/Firebug output.

jsFiddle: http://jsfiddle.net/i_like_robots/HKAQ9/

Answer №1

In my opinion, there seems to be a bug present in Opera.

During the calculation of an element's width, it takes into account the total width of all child elements. However, if you have 2 Div elements as children displayed as block elements, the actual width is not the sum of both elements.

To resolve this issue, simply specify the width of the parent element instead of relying on Opera for calculations.

@clairesuzy - You can witness the bug by running the provided code here:

Answer №2

I am not sure of the reason yet (I will investigate later)

However, Opera seems to have an issue with the replace class not having a specified width

.replace {
    display:block;
    overflow:hidden;
    text-indent:-9999px;
    background: no-repeat 0 0;
    width: 10px;
}

It seems like the purpose of this class is to contain a replacement background image, so it should be acceptable to include a width for it?

Update: The issue is related to the use of the text-indent property for hiding text - removing the text indent resolves the problem in Opera as well

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 it possible to incorporate MUI React components within an iframe?

Looking to replicate the style seen in this Material UI website screenshot, I aim to design a container that will encompass my iframe contents, such as the navBar and menu drawer. However, I want to utilize Material UI's components for these elements. ...

What is the best way to navigate from one div to a particular slide within a slider?

Let's say I have two web pages: index.html and page.html. On page.html, there is a slider with 9 slides created using the plugin StackSlider. Now, when a link on index.html is clicked, I want to navigate to a specific slide, like slide number 4, on pa ...

Picture in the form of a radio button

Is there a way to use an image instead of a radio button in my AngularJS form? I have managed to hide the radio button using CSS, but it disables the checked event. How can I make the image clickable? position: absolute; left: -9999px; Here is the code s ...

Positioning the icon within the input field

I am facing a couple of challenges. I have chosen to utilize focus and blur for text values in input fields instead of placeholder text due to an issue in Chrome where the placeholder text is centered. My goal is to position the icon in the input field, p ...

Expand the object by clicking on it, causing the surrounding objects to move outside the viewport instead of appearing below

I'm facing a challenge with 3 squares inside one container, each occupying 33.33% of the viewport and placed next to each other. When I click on one square, it should expand to full viewport width and reveal hidden content, while the other two remain ...

Ensure that when you click on the next dropdown menu opener button, the previous dropdown menu closes and only the new menu remains open

Take a look at this page first to get an understanding: On this page, I have implemented multiple dropdown menus that should open when clicked on their respective opener buttons (3 bar icon) and close either when clicked again or anywhere else on the page ...

How can I prevent the repetition of a background image causing empty spaces?

Encountered an issue with a repeating background image. In instances where the content is relatively short, shorter than the height of the screen, the background image continues to repeat for the remaining space. Please refer to the accompanying screensh ...

Trouble arising from Bootstrap 5's float-end on flex items

When I apply the float-end class, it shifts the button to the right, but the div tags next to it appear in front of it. https://i.sstatic.net/Mxu0P.png <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protecti ...

Modifying Table Cell Background Color in ReactJS: A Guide to Conditionally Updating Cell Color Without Affecting the Entire Row

I am working on changing the background color of a cell based on its value. Currently, I am utilizing the following library: react-data-table-component Procedure: If the value is above 0, then the cell's background color will be red. Otherwise, th ...

Issue with vertical alignment of subscripts and superscripts

I am working with two buttons that manipulate the verticalAlign property. One button is supposed to set it to sub and the other is supposed to set it to sub. However, both buttons end up setting it to sub. Here is the code for both actions: Superscript d ...

Utilizing Node and Electron to dynamically adjust CSS style properties

Having a dilemma here: I need to access the CSS properties from styles.css within Electron. Trying to use document.getElementsByClassName() won't work because Node doesn't have document. The goal is to change the color of a specific div when the ...

Calibrating height using CSS

Within my HTML document, I have the following structure: <div id="content"> <div id="wrapper"> <div id="steps"> <form id="formElem" name="formElem" action="" method="post"> <fieldset class ...

Creating a secondary title for a Bootstrap Navigation Bar

I have a unique Bootstrap 4 website that features a navbar. The navbar consists of a special brand section with an image and title text, followed by the rest of the navbar elements. You can view it here: https://jsfiddle.net/zmbq/aq9Laaew/218793/ Now, I a ...

Spin background from center to edge

My goal is to create a CSS design that works seamlessly on all screen sizes. I want the background to transition from blue on the left side to white on the upper middle to the right bottom corner. Here is my current code snippet: <style> .wrapper { ...

The connected callback does not trigger when custom HTML elements are being created

Attempting to craft a custom HTML tag using JavaScript, I aimed to create the custom element with ES6 JavaScript syntax. The code devised for this task reads as follows: customElements.define('neo-element', NeoElement); function NeoElement (){ ...

What is the best approach for implementing various colors and styles using CSS?

I want to give each word in my website name a different color or style, similar to this: Currently, I am using: <a href="#">James<strong>.</strong><span>Wood</span></a> (Using "STRONG" and "SPAN" tags inside the "A" t ...

- increase clarity and readability- separate sections for better

I'm working on a code snippet to showcase 4 buttons: #buttons { text-align: center; padding-top: 4%; } #buttons img { display: inline-block; list-style: none; padding: 10px; } #buttons p { color: #fff; font-family: ; font-weight: ...

Triggering jQuery events can be customized by excluding certain elements using the

Is there a way to hide the div "popu" when clicking on the img "tri"? I've tried using .not() since the img is a child of the div popu, but it didn't work. Also, I need to make sure that clicking on the div "textb" does not trigger the hide actio ...

Using jQuery to eliminate the 'disabled' attribute from CSS

After using the .val() method to enter data into a text box, I noticed that when trying to click "add", the button appears disabled. <input class="btn-primary action-submit" type="submit" value="Add" disabled=""> If I manually type in text, the dis ...

Looking to verify a disabled select element and adjust the opacity of that element when it is disabled

$_product = $this->getProduct(); $_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes()); ?> <?php if ($_product->isSaleable() && count($_attributes)):?> <dl> <?php foreach($_attrib ...