Css
Resolve IE5/IE5.5/IE6/FF compatibility issues--CSS
Previously found several different versions of the Internet Explorer can run independently, just to try to test the compatibility of the page. Don't try not to know, in IE6 and FF no problem page in IE5 and IE5.5 mess, has been heard that IE5 is a Web standard production of a "nail", now have to believe.
Since there are problems, then find a solution to
In the CSS Forest group to discuss a margin problem inadvertently found overflow can also be used to clear the float, hey, this method is not only simple to use, but also FF, OP, IE7 support, from then on the long compatibility and poor FF clear floating method.
The method is really simple, as long as you add the overflow this property to the label that needs to be floated.
CSS Code
Copy Code code
to the button's click Action, through post submission, for the user input is a text box, the user input to fill in after the item, directly press ENTER, it is equivalent to press the button, At the beginning did not pay attention to this problem, a press RETURN, jump to another page, a lot of data, just found to block the browser's default behavior, because the default behavior is submit form, then your JS will not be implemented. So cancel the default behavior first. Then execute your JQ to su
MediaPlayer online player code compatible with IE and FF
Online player inserts MediaPlayer compatible with IE and FF code debugging in Web pagesInternet Explorer and Netscape support So all two tags have to be written, and attribute values need to correspond.–>Type= "Application/x-oleobject" >Type= "Application/x-mplayer2" autostart= "0" enablecontextmenu= "0" >Description of the player related parameters
The difference between window.event and in IE and FF
The event object is valid only if it occurs.
Some properties of an event are only meaningful for a particular event. For example, the Fromelement and Toelement properties only make sense for Onmouseo tutorials ver and onmouseout events.
Example
The following example checks to see if the mouse clicks on the link and cancels the link jump if the SHIFT key is pressed.
Window.eventie: there are
BS development will inevitably use JavaScript, and each browser's support for JavaScript is different. This requires our programmers to be compatible with them, or some browsers will not be able to run our code. Will create a customer complaint, if let boss know, this is not very good oh.
The following is compatible with IE and FF JS scripting practices and decomposition (some selected from the Internet, by my collation), I hope to help.
. Use IE in
JavaScript seamlessly scroll up and down Gao Dingkuan Pause effect (compatible IE/FF)
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
JavaScript Seamless scrolling around Gao Dingkuan Pause effect (compatible with IE/FF)
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
This article describes the JS implementation compatible with IE, FF, Chrome, opera and Safari music players. Share to everyone for your reference. The implementation method is as follows:
/** Music player * @param obj player ID * @param file Audio file mp3:ogg: * @param loop whether loop/function Audioplayer (ID, file, lo
OP) {var audioplayer = document.getElementById (ID);
if (audioplayer!=null) {document.body.removeChild (Audioplayer); }
Event is an object that IE comes with, and the object is not present in FF, and can only simulate event by passing parameters
In addition, using srcelement in IE to get event trigger source, use target under FF. Therefore, the use of these two objects requires related browser compatibility.
Copy Code code as follows:
View Run Results
Combined with attachevent and AddEventListen
1. Div centering problemDiv set Margin-left, margin-right for Auto is already centered, ie not, ie need to set the body center, first in the parent element definition text-algin:center; This means that the content within the parent element is centered.
2. Link (A-label) border and backgroundA link with border and background color, need to set Display:block, and set Float:left guarantee not wrap. Refer to MenuBar, set a and menubar height is to avoid the bottom of the display dislocation, i
CSS compatibility with various browsers is already a common issue, and tutorials on the Internet are everywhere. The following content is not too novel. It is a personal summary and I hope it will be helpful for beginners.
I. CSS hack
Hack concept:Different browsers, such as Internet Explorer 6, Internet Explorer 7, and Mozilla Firefox, have different understandings of CSS parsing, which leads to different page effects, we cannot get the page effect we need. At this time, we need to write
P {+ color: # f00;} supports IE6 IE7 and does not support FF IE8P {_ color: # f00;} supports IE6 and does not support FF.P {color: # 00f! Important ;}P {color: # f00;} supports IE7 IE6 FF IE8P {color: # 00f! Important; color: # f00;} supports IE7 IE8 FF and does not support IE6Head: first-child + body p {color: # f00;} supports IE7 IE8
FF Firebug, not only can test JS can also check CSS errors, is generally used.But it is mainly to check the FF error, IE is powerless.To test IE, use ietester, it can test almost all versions of IE (1.0 I'm afraid it won't be tested), usage is also very convenient.As for JS to different browser compatibility considerations, indeed a lot, the following is only part of you, general advice or use jquery,protot
css| Solve | The problem
Previously found several different versions of the Internet Explorer can run independently, just to try to test the compatibility of the page. Don't try not to know, in IE6 and FF no problem page in IE5 and IE5.5 mess, has been heard that IE5 is a Web standard production of a "nail", now have to believe.
Since there are problems, then find a solution to it, a search on the Internet, the relevant articles or a lot of, think the
Differences between JS and CSS in IE and Firefox (FF)
CSS:
1.
In the UL tag, FF has a padding value, but there is no margin value. In ie, the opposite is true.
Solution: Set UL's padding and margin to 0 (or not 0), for example, padding: 0; margin: 0; List-style: none;
JS:
1.
In IE, innertext is not in ff, and textcontent is used;
Eg:
CopyCode The Code is
Differences between js and css in IE and FireFox (FF)Css: 1.In the ul tag, FF has a padding value, but there is no margin value. In IE, the opposite is true.Solution: Set ul's padding and margin to 0 (or not 0), for example, padding: 0; margin: 0; list-style: none;Js: 1.In IE, innerText is not in FF, and textContent is used;Eg:Copy codeThe Code is as follows:Var
1. If an html Tag is set to $ (id) or getElementById, you must add the id attribute to the tag. IE and FF are compatible. For example, $ (mobile): If the input of mobile does not have the id attribute, the variable undefined will be reported in FF;2. Take a tag object in the form. If you want IE and FF compatibility, change formMain. item to document. formName. i
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.