Home Web Front-end JS Tutorial What should I do if the browser is not compatible with the code I wrote?

What should I do if the browser is not compatible with the code I wrote?

Mar 07, 2018 pm 02:54 PM
firefox webkit what to do

This time I will bring you what to do if the browser is not compatible with the code I wrote, and a summary of the six major browser compatibility issues. The following is a practical case, let’s take a look.

1. Problem 1
Problem symptoms: Just write a few tags without style control, and their respective margins and padding will be quite different.
Solution: Add *{margin:0;padding:0;} in CSS
2. Problem 2
Problem symptoms: The height of this label in IE6, 7 and Aoyou is uncontrolled and exceeds its own Set height
Solution: Set overflow:hidden; for labels that exceed the height; or set the line height line-height to be less than the height you set.
3. Problem 3
Symptoms: dispaly:inline_block in css has no effect;
Solution: Add display:inline after display:inline_block;
4. Problem 4
Symptoms : The spacing between multiple img tags cannot be removed, and using *{margin:0;padding:0;} does not work either.
Solution: Use float;
5. Problem 5
Symptoms: Because min-height itself is an incompatible CSS property, setting min-height cannot be well compatible with various browsers
Solution : If we want to set the minimum height of a label to 200px, the settings that need to be made are: {min-height:200px; height:auto !important;
height:200px; overflow:visible;}

6 , Question 6
Symptoms: z-index failure
Cause: There is a small prerequisite for z-index to work, that is, the position attribute of the element must be relative, absolute or fixed.
Solution:
1. Change position:relative to position:absolute;
2. Remove floating;
3. Add position attribute (such as relative, absolute, etc.) to floating elements.
7. Problem 7
Symptoms: Element horizontal centering problem
Solution: FF: margin:0 auto;
IE: parent { text-align:center; }

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Related reading:

Summary of commonly used array methods in JS

2018 latest front-end interview questions 12

2018 Latest Front-End Interview Questions Ten

The above is the detailed content of What should I do if the browser is not compatible with the code I wrote?. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if I forget my Ouyi Wallet mnemonic phrase? Can it still be found? What should I do if I forget my Ouyi Wallet mnemonic phrase? Can it still be found? Jul 19, 2024 pm 12:13 PM

In the Web3 world, although it is free, it is full of dangers. Therefore, the first step in the security of Ouyi wallet is to protect the private key and mnemonic phrase. Everyone knows the importance of private keys, and today the emphasis is on mnemonics. The mnemonic phrase can be understood as another form of presentation of the private key. Having the mnemonic phrase is equivalent to owning the private key and controlling the wallet assets. It is also thought that its presence is lower than that of the private key, and users may forget the mnemonic phrase of Ouyi Wallet. So what should I do if I forget the mnemonic phrase of Ouyi Wallet? Can I still retrieve my Ouyi Wallet mnemonic if I forget it? Issues that users need to pay attention to. Generally speaking, if the mnemonic phrase is forgotten, it cannot be retrieved, but try to contact the relevant customer service personnel for help. The editor below will tell you in detail. What should I do if I forget my Ouyi Wallet mnemonic phrase? If you forget the mnemonic phrase of Ouyi Wallet, please try to recall it or contact us.

What to do if snowflakes appear on your TV (A practical way to solve the problem of snowflakes on your TV) What to do if snowflakes appear on your TV (A practical way to solve the problem of snowflakes on your TV) Jun 01, 2024 pm 09:44 PM

In our daily lives, TV, as an important entertainment device, often suffers from snowflakes, which affects our viewing experience. This article will introduce you to practical methods to solve the TV snow problem and help you enjoy TV programs better. 1. Analysis of the causes of snowflake problems Snowflakes appearing on TVs are generally caused by signal interference, antenna problems or TV signal sources. 2. Check whether the antenna connection is loose. First, check whether the connection between the TV and the antenna is firm. If it is loose, plug it in again. 3. Choose a suitable antenna to ensure that the position and direction of the antenna are correct. Choosing an antenna with good performance can improve the signal reception quality. 4. Adjust the direction of the antenna. Find the best signal reception direction by rotating or adjusting the angle of the antenna. 5. Use indoor antenna signals

Solve the problem of being unable to access the Internet even though the broadband is connected (troubleshooting) Solve the problem of being unable to access the Internet even though the broadband is connected (troubleshooting) May 05, 2024 pm 06:01 PM

The Internet has become an indispensable part of people's lives in today's information age. But we can't get online, and sometimes we encounter some troubles. However, for example, the broadband is already connected. And take corresponding solution measures, we need to troubleshoot the problem step by step to restore the network connection in this case. Confirm the device connection status: Whether the mobile phone and other devices have been correctly connected to the broadband network, check the computer to ensure that the wireless network or wired network connection is normal. 2. Restart the broadband device: Reset the device and re-establish the connection, wait a few minutes and then turn it back on again. Try turning off the broadband router or modem. 3. Check the broadband account number and password: To avoid being unable to access the Internet due to incorrect account or password, make sure the broadband account number and password entered are correct. 4. Check D

What to do if pagefile.sys takes up too much space What to do if pagefile.sys takes up too much space Feb 20, 2024 am 09:01 AM

What should I do if pagefile.sys takes up too much space? In the process of using the computer, we often encounter insufficient memory. In order to solve this problem, the operating system will transfer part of the data in the memory to a special file on the disk. This file is pagefile.sys. But sometimes, we will find that the pagefile.sys file is very large and takes up too much disk space. So, how do we solve this problem? First, we need to clarify the pagefile.sys file

What should I do if the icon in the lower right corner of win11 does not respond when I click it? What should I do if the icon in the lower right corner of win11 does not respond when I click it? Jun 29, 2023 pm 01:54 PM

What should I do if the icon in the lower right corner of win11 does not respond when I click it? The shortcut icon for the currently running task can be displayed in the lower right corner of the computer. Just click on the icon to continue running the task, which is very convenient. However, many users find that the task icon shortcut key in the lower right corner of the win11 system does not respond after clicking it. What is going on? Today, the editor will give you a tutorial on how to solve the problem of clicking the shortcut in the lower right corner of win11. Users in need should quickly take a look. What should I do if the icon in the lower right corner of win11 does not respond? 1. First, press the "win" button on the keyboard, and then click "Settings". 2. Then click "About" under system settings. 3. Then find the blue font "Advanced system settings" under the device specifications.

How to remove Firefox Snap in Ubuntu Linux? How to remove Firefox Snap in Ubuntu Linux? Feb 21, 2024 pm 07:00 PM

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

What should I do if the software running on my win7 computer is incompatible? What should I do if the software running on my win7 computer is incompatible? Jul 13, 2023 pm 06:49 PM

What should I do if the win7 operating software is incompatible? When we copy a program from the old system to win7 for installation, it will fail to install. This is an incompatibility issue with win7 operating software. So what should I do if the win7 operating software is not compatible? Here, I will share with you solutions to the incompatibility of win7 operating software. What to do if the software running on your win7 computer is incompatible: 1. Right-click the incompatible software or program. 2. Click the Properties option in the pop-up menu list. 3. Click the Compatibility tab in the pop-up properties window. 4. Find the Run this program in compatibility mode option under the Compatibility tab. 5. Check the Run this program in compatibility mode option as shown! 6. Done! Note: This method is not valid for some software

How to copy with HP printer How to copy with HP printer Jan 06, 2024 am 08:44 AM

HP is a well-known printer brand. They have launched many different styles and models of printers, each with different functions and uses. However, the most basic functions are for printing and copying documents. Here, we take the HP printer v50157037-1 model as an example to introduce how to perform copy operations. First, make sure your HP printer is connected to a computer or network and the driver is installed. Next, open the document you want to copy and place it on the printer's scanning plate. Then, open the HP printer's control panel, which can usually be found on the printer's control panel or through the printer settings on your computer. On the control panel, you will see some buttons or menu options for

See all articles