本文不考虑兼容 IE6
我是名前端实习生,刚上班没多久就遇到了一个很赶的项目,要求我为大量的页面做CSS兼容,以前我自学的时候,折腾过 CSS Hack,没想到业务中的情况更加复杂。因为工作量有点大, 而公司只有我一个前端...我怕我之前学到的皮毛不够规范、不够清晰,会带来潜在的问题,所以匆忙整理笔记的时候,发现现在网上很多CSS Hack大全之类的教程都有点旧,普遍在 IE9 之后的时间都没有更新了,所以今天来请教一下。
首先我之前学习的时候,我是把浏览器兼容分为 Firefox 标准、Chrome 标准 和 IE7 标准,一般情况下我会写一个适合 IE7 (或者说绝大部分 IE 版本)的 CSS( .name{}),然后再根据 Firefox ( @-moz-document url-prefix(){.name{}})或者 Chrome ( @media screen and (-webkit-min-device-pixel-ratio:0){.name{}})去调整
所以 1、请问按照普遍网民的浏览器使用情况,我这样的分配兼容方案和CSS Hack写法合理不?如果不合理的话,应该怎么规范地分配和编写?
还有今天发现,同一个网页有个 ul 的长度,我在我的 Windows10 + IE11中是设置了宽度为 215px ,但是在经理的 Windows7 + IE11 中却短了足足 20px ,我的 IE 版本是11.192,更新版本为11.0.29,而经理的 IE 版本是 11.0 更新版本为11.0.29,难道 IE11 也有很多个版本? 2、遇到这种情况该如何处理?
谢谢指教!
回复讨论(解决方案)
1. 实践出真知,你只有模拟不同的环境,看看能否达到这样的效果
2. 真没碰到过这样的情况,不过,你可以看看你经理的浏览器有没有放大或缩小,我曾经就碰到过类似情况,字体变大了,但表格宽度不变,结果导致标题换行,想半天没想出原因,后来一看,浏览器被放大到110%,恢复后一切正常
1. 实践出真知,你只有模拟不同的环境,看看能否达到这样的效果
2. 真没碰到过这样的情况,不过,你可以看看你经理的浏览器有没有放大或缩小,我曾经就碰到过类似情况,字体变大了,但表格宽度不变,结果导致标题换行,想半天没想出原因,后来一看,浏览器被放大到110%,恢复后一切正常
我想问一下用什么东西可以模拟各种浏览器的环境呢,逐个逐个去下载真的好苦
第二个我发现了,是之前下的人打多了一个 li,然后在我的 IE11里这个 li 不占位,经理的 IE 里居然占了点位,撑高了整个 ul ,所以长了20px
找一个 CSS Reset, 一般情况下,不用比较新的CSS属性的话,不需要自己写Hack。要么用CSS框架看看。
想问一下用什么东西可以模拟各种浏览器的环境呢
想问一下用什么东西可以模拟各种浏览器的环境呢
首先是安装几个浏览器,然后几个常用的浏览器基本都有F12工具,如IE、Chrome、Firefox和Safari等。并且这些浏览器还能模拟不同的版本,你可以找找看
用 IE texter 去调试 这样就会知道每个浏览器的不同
用 IE texter 去调试 这样就会知道每个浏览器的不同
这个问题能帮一下吗,我现在就是想重写一下那个事件
【http://bbs.csdn.net/topics/391930703?page=1#post-401040430】
兼容性问题应当分下轻重缓急,列出最重要的来。

A consistent HTML encoding style is important because it improves the readability, maintainability and efficiency of the code. 1) Use lowercase tags and attributes, 2) Keep consistent indentation, 3) Select and stick to single or double quotes, 4) Avoid mixing different styles in projects, 5) Use automation tools such as Prettier or ESLint to ensure consistency in styles.

Solution to implement multi-project carousel in Bootstrap4 Implementing multi-project carousel in Bootstrap4 is not an easy task. Although Bootstrap...

How to achieve the effect of mouse scrolling event penetration? When we browse the web, we often encounter some special interaction designs. For example, on deepseek official website, �...

The default playback control style of HTML video cannot be modified directly through CSS. 1. Create custom controls using JavaScript. 2. Beautify these controls through CSS. 3. Consider compatibility, user experience and performance, using libraries such as Video.js or Plyr can simplify the process.

Potential problems with using native select on mobile phones When developing mobile applications, we often encounter the need for selecting boxes. Normally, developers...

What are the disadvantages of using native select on your phone? When developing applications on mobile devices, it is very important to choose the right UI components. Many developers...

Use Three.js and Octree to optimize collision handling of third-person roaming in the room. Use Octree in Three.js to implement third-person roaming in the room and add collisions...

Issues with native select on mobile phones When developing applications on mobile devices, we often encounter scenarios where users need to make choices. Although native sel...


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

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

Dreamweaver CS6
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version
Useful JavaScript development tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment
