


Strange phenomenon of style setting width under Firefox_Experience exchange
There is a data list on the page, which is a table and is placed in a div window with the following structure:
Set the style for the container #container {width:100%; margin:10px;}
Set the style for the grid Style #grid {width:100%}
The test results are normal in IE. Under Firefox, the actual width of the container will exceed 100% and a horizontal scroll bar will appear. Because Firefox counts margin into the width, it is actually equal to 100% 20px>100%.
Of course, you can remove the margin definition of the div and use the padding of the body to set it, but there are other contents on the page that need to occupy the entire page.
So in the past, in order to solve this problem, I would define a width: 98% for divs in Firefox. This seems to have solved the problem, but if the browser window becomes smaller, the 98% 20px under Firefox may be greater than 100%. A horizontal scroll bar appears.
To give it a try, I changed the container style to #container {width:100%-20; margin:10px}, and then went to Firefox to take a look. Haha, it turned out to be normal. , it’s the same as under IE, it’s really strange, the definition of width: 100%-20 should be wrong! But it solved the problem of Firefox including margin. I tried it further and found that it can be reduced by any number from 100%. After checking some information, I still didn't understand the reason.
Maybe it’s just a bug, haha! Maybe some expert knows the reason. I have tested it myself and posted the code and screenshots:

[Ctrl A Select all Note:If you need to introduce external Js, you need to refresh it to execute]

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



To remove FirefoxSnap in Ubuntu Linux, you can follow these steps: Open a terminal and log in to your Ubuntu system as administrator. Run the following command to uninstall FirefoxSnap: sudosnapremovefirefox You will be prompted for your administrator password. Enter your password and press Enter to confirm. Wait for command execution to complete. Once completed, FirefoxSnap will be completely removed. Note that this will remove versions of Firefox installed via the Snap package manager. If you installed another version of Firefox through other means (such as the APT package manager), you will not be affected. Go through the above steps

Mozilla Firefox can be uninstalled; Firefox is a third-party browser and can be uninstalled if it is not needed. Uninstallation method: 1. In the Start menu, click "Windwos System" - "Control Panel"; 2. In the "Control Panel" interface, click "Programs and Features"; 3. In the new interface, find and double-click Firefox Browser icon; 4. In the uninstall pop-up window, click "Next"; 5. Click "Uninstall".

According to recent news, while Mozilla released the stable version of Firefox 112, it also announced that the next major version, Firefox 113, has entered the Beta channel and supports AV1 animations, enhanced password generator and picture-in-picture features. The main new functions/features of Firefox 113 are as follows: Support for AV1 format animated images (AVIS); Enhance the security of the password generator by introducing special characters; Enhance the picture-in-picture function, support rewind, display video time, and enable full screen more easily Mode provides official DEB installation files for Debian and Ubuntu distributions. Updated bookmark import feature, icons for imported bookmarks are supported by default. Hardware accelerated AV1 video decoding is enabled by default on supported hardware using w

For crawlers to crawl websites that require login, verification code or scan code login is a very troublesome problem. Scrapy is a very easy-to-use crawler framework in Python, but when processing verification codes or scanning QR codes to log in, some special measures need to be taken. As a common browser, Mozilla Firefox provides a solution that can help us solve this problem. The core module of Scrapy is twisted, which only supports asynchronous requests, but some websites require the use of cookies and

Today’s latest news, Mozilla officially released the Firefox 115 stable version update today. The most noteworthy thing about this update is that this is the last version that supports Win7/Win8, macOS10.12, 10.13 and 10.14. Download address: https://ftp.mozilla.org/pub/firefox/releases/115.0/Mozilla stated in the official update log: Microsoft will end support for Win7 and Win8 systems in January 2023, and Firefox 115 released today The version is the last version update received by users of said system. Win7 and Win8 users

Canonical recently announced that in the upcoming Ubuntu 23.10, Firefox Snap has been configured to run in Wayland mode by default. Note: Ubuntu currently has the Wayland session by default, and Firefox can also work normally. However, currently FirefoxSnap actually runs in XWayland compatibility mode, rather than the strict native Wayland mode. Canonical announced that it will run the Firefox browser in Wayland mode by default, so that problems such as interface blur and scaling distortion will not occur on HiDPI displays, and it will support touch gestures such as dragging and pinching. As mentioned above, Ubunt

New news yesterday: While Mozilla released the Firefox 114 stable version update, it also shifted its development focus to the Firefox 115 version and launched the Beta version today. It is learned from reports that Firefox 115 introduces CookieBannerReduction and QuickActions buttons that were originally planned to be launched in version 114. After users enable CookieBannerReduction in Firefox version 115 and visit supported websites, the browser will automatically reject cookie requests on cookiebanners. The second feature is the QuickActions button on the address bar

1. nginx server solution The server uses nginx. To add the access-control-allow-origin field to the response header, the method of adding is to use the add_header directive: Configuration example: Copy the code as follows: location/assets/{gzip_staticon; expiresmax;add_headercache-controlpublic;add_headeraccess-control-allow-origin*;} 2. Apache server solution fontawesome (firefox cannot display fire
