CSS for browser compatibility problem solutions, tested in IE, FF, chrome

Source: Internet
Author: User

What is the core of the current master browser?

1) Trident:ie Browser uses the kernel, the kernel program in the 1997 IE4 for the first time, is Microsoft in the Mosaic code based on the modified, and continue to the current IE7. Trident is actually an open kernel, its interface core design is quite mature, so there are many using IE kernel and not IE browser emerged (such as Maxthon, TheWorld, TT, Greenbrowser, Avantbrowser, etc.).

2) Geckos:netcape6 began to adopt the kernel, the later FF also adopted the kernel, geckos is characterized by the full disclosure of the code, so it is highly developed, the world's programmers can write code for it, add functionality.

3) Presto: The current core of opera, which was first used in the 2003 Opera7, is characterised by the ultimate in rendering speed optimization and the most popular browser core for web browsing, but at the expense of Web compatibility.

4) Webkit:safari The kernel used by the browser. Google's Chrome browser also uses WebKit. The WebKit engine includes the WebCore typesetting engine and the JavaScriptCore parsing engine, all derived from KDE's khtml and KJS engines, which are free software, licensed under the GPL, and supporting the development of BSD systems. So WebKit is also free software, while open source code. In terms of security, ie, Firefox is not restricted, so the Safari browser is still a more secure browser.

Some of the examples I've compiled have been tested in Google, IE7, IE8, IE9, IE10, ff.

Instance:

1) Hide the browser scroll bar

Problem:

Hide the browser's scroll bar

Solve:

1) Only IE7 support <bodyscroll= "no" >

2) Except IE7 does not support Body{overflow:hidden}

3) all browsers Html{overflow:hidden}

Instance:

1) only IE7 support <body scroll= "No" >

<style= "font-size:18px;" >           <  scroll= "No"></body></span >

2) Except IE7 does not support Body{overflow:hidden}

    <style= "font-size:18px;" >           <  style= "Overflow:hidden"></body></ span >  

3) all browsers Html{overflow:hidden}

<style= "font-size:18px;" >           <  style= "Overflow:hidden"></body></  Span>
Hover style does not appear after hyperlinks have been accessed

Problem:

Hover, active style has no effect after clicking Hyperlink

Solve:

Changing the ordering of CSS properties: l-v-h-a

<style type= "Text/css" > A:link{Color:#FF0000}/*non-visited links*/a:visited{Color:#00FF00}/*links that have been visited*/a:hover{Color:#FF00FF}/*when there is a mouse hover over the link*/a:active{Color:#0000FF}/*Selected Links*/</style>
Content in Li is displayed in ellipses

Problem:

When the content in Li exceeds the length, want to display with ellipsis, this method is suitable for IE7, 8, 9, 10, Google, FF browser

Li {  list-style-type:none;   width:200px;    white-space:nowrap;   text-overflow:ellipsis;    Overflow: hidden;    
Make a continuous long field wrap
Div     {         width:300px;          word-wrap:break-word;        Border:1px solid red;}

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.