能分析一下左边肋骨比右边突出是不是喜欢右边的?

百度拇指医生
&&&普通咨询
您的网络环境存在异常,
请输入验证码
验证码输入错误,请重新输入学了这么多年数学,有一个一直疑惑的问题。为什么老师们都喜欢把图画在右边,而不是更方便观察的左边?
&img data-rawwidth=&3024& data-rawheight=&4032& src=&/175dffcd30bf4_b.jpg& class=&origin_image zh-lightbox-thumb& width=&3024& data-original=&/175dffcd30bf4_r.jpg&&&img data-rawwidth=&3024& data-rawheight=&4032& src=&/c4b8d4fce4e6e6171425d_b.jpg& class=&origin_image zh-lightbox-thumb& width=&3024& data-original=&/c4b8d4fce4e6e6171425d_r.jpg&&&img data-rawwidth=&3024& data-rawheight=&4032& src=&/4bbcca0a00c4_b.jpg& class=&origin_image zh-lightbox-thumb& width=&3024& data-original=&/4bbcca0a00c4_r.jpg&&&img data-rawwidth=&3024& data-rawheight=&4032& src=&/bd50ef9d29_b.jpg& class=&origin_image zh-lightbox-thumb& width=&3024& data-original=&/bd50ef9d29_r.jpg&&&img data-rawwidth=&3024& data-rawheight=&4032& src=&/fcac01dfa0fc00a3fa433ab6b672da3a_b.jpg& class=&origin_image zh-lightbox-thumb& width=&3024& data-original=&/fcac01dfa0fc00a3fa433ab6b672da3a_r.jpg&&&img data-rawwidth=&3024& data-rawheight=&4032& src=&/3f3e3ad8e_b.jpg& class=&origin_image zh-lightbox-thumb& width=&3024& data-original=&/3f3e3ad8e_r.jpg&&
使文字左对齐不受影响。
已有帐号?
无法登录?
社交帐号登录请问一下图的左边的是音响电池,右边的是电瓶,我把右边的电瓶接到左边音响可以吗?这样会不会短路??_百度知道
请问一下图的左边的是音响电池,右边的是电瓶,我把右边的电瓶接到左边音响可以吗?这样会不会短路??
jpg" esrc="http.baidu.hiphotos./zhidao/wh%3D600%2C800/sign=/zhidao/wh%3D450%2C600/sign=/zhidao/pic/item/eac4b05a849a8c82b9014b90ebf0.hiphotos://h;
来自团队:
其他类似问题
为您推荐:
电瓶的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁为什么排版引擎解析 CSS 选择器时一定要从右往左解析?
按投票排序
首先我们要看一下选择器的「解析」是在何时进行的。主要参考这篇「 How browsers work」()来看,浏览器渲染的过程以 WebKit 为例大致如下:HTML 经过解析生成 DOM Tree(这个我们比较熟悉);而在 CSS 解析完毕后,需要将解析的结果与 DOM Tree 的内容一起进行分析建立一棵 Render Tree,最终用来进行绘图。Render Tree 中的元素(WebKit 中称为「renderers」,Firefox 下为「frames」)与 DOM 元素相对应,但非一一对应:一个 DOM 元素可能会对应多个 renderer,如文本折行后,不同的「行」会成为 render tree 种不同的 renderer。也有的 DOM 元素被 Render Tree 完全无视,比如 display:none 的元素。HTML 经过解析生成 DOM Tree(这个我们比较熟悉);而在 CSS 解析完毕后,需要将解析的结果与 DOM Tree 的内容一起进行分析建立一棵 Render Tree,最终用来进行绘图。Render Tree 中的元素(WebKit 中称为「renderers」,Firefox 下为「frames」)与 DOM 元素相对应,但非一一对应:一个 DOM 元素可能会对应多个 renderer,如文本折行后,不同的「行」会成为 render tree 种不同的 renderer。也有的 DOM 元素被 Render Tree 完全无视,比如 display:none 的元素。在建立 Render Tree 时(WebKit 中的「Attachment」过程),浏览器就要为每个 DOM Tree 中的元素根据 CSS 的解析结果(Style Rules)来确定生成怎样的 renderer。对于每个 DOM 元素,必须在所有 Style Rules 中找到符合的 selector 并将对应的规则进行合并。选择器的「解析」实际是在这里执行的,在遍历 DOM Tree 时,从 Style Rules 中去寻找对应的 selector。因为所有样式规则可能数量很大,而且绝大多数不会匹配到当前的 DOM 元素(因为数量很大所以一般会建立规则索引树),所以有一个快速的方法来判断「这个 selector 不匹配当前元素」就是极其重要的。如果正向解析,例如「div div p em」,我们首先就要检查当前元素到 html 的整条路径,找到最上层的 div,再往下找,如果遇到不匹配就必须回到最上层那个 div,往下再去匹配选择器中的第一个 div,回溯若干次才能确定匹配与否,效率很低。逆向匹配则不同,如果当前的 DOM 元素是 div,而不是 selector 最后的 em,那只要一步就能排除。只有在匹配时,才会不断向上找父节点进行验证。但因为匹配的情况远远低于不匹配的情况,所以逆向匹配带来的优势是巨大的。同时我们也能够看出,在选择器结尾加上「*」就大大降低了这种优势,这也就是很多优化原则提到的尽量避免在选择器末尾添加通配符的原因。现学现卖,如有理解错误欢迎指正。
Keep in mind that when a browser is doing selector matching it has one
element (the one it's trying to determine style for) and all your rules
and their selectors and it needs to find which rules match the element.
This is different from the usual jQuery thing, say, where you only have
one selector and you need to find all the elements that match that
If you only had one selector and only one element to compare against
that selector, then left-to-right makes more sense in some cases. But
that's decidedly not the browser's situation. The browser is trying to
render Gmail or whatever and has the one
it's trying to style and the 10,000+ rules Gmail puts in its stylesheet (I'm not making that number up).
In particular, in the situation the browser is looking at most of the
selectors it's considering don't match the element in question. So the
problem becomes one of deciding that a selector doesn't match
if that requires a bit of extra work in the cases that do
match you still win due to all the work you save in the cases that don't
If you start by just matching the rightmost part of the selector against
your element, then chances are it won't match and you're done. If it
does match, you have to do more work, but only proportional to your tree
depth, which is not that big in most cases.
On the other hand, if you start by matching the leftmost part of the
selector... what do you match it against? You have to start walking the
DOM, looking for nodes that might match it. Just discovering that
there's nothing matching that leftmost part might take a while.
So browsers
it gives an obvious starting point and
lets you get rid of most of the candidate selectors very quickly. You
can see some data at
(though the notation is confusing), but the upshot is that for Gmail in
particular two years ago, for 70% of the (rule, element) pairs you
could decide that the rule does not match after just examining the
tag/class/id parts of the rightmost selector for the rule. The
corresponding number for Mozilla's pageload performance test suite was
72%. So it's really worth trying to get rid of those 2/3 of all rules as
fast as you can and then only worry about matching the remaining 1/3.
Note also that there are other optimizations browsers already do to
avoid even trying to match rules that definitely won't match. For
example, if the rightmost selector has an id and that id doesn't match
the element's id, then there will be no attempt to match that selector
against that element at all in Gecko: the set of "selectors with IDs"
that are attempted comes from a hashtable lookup on the element's ID. So
this is 70% of the rules which have a pretty good chance of matching
that still don't match after considering just the tag/class/id of the
rightmost selectorvia Boris Zbarsky()
野路子答案:英文顺序中一向是先小后大,先具体后宽泛。比如姓名是先名后姓、地址是X号X街X城市X州、日期是月/日/年。私以为西方比较强调个体价值,中国比较注重家族观念强调继承与服从。
从右往左解析,跟从左往右解析效率应该是一样的。因为:从右往左解析,如果找不到最里层的那个样式名,则放弃解析。如果里层的都找到了,就最外层的样式名不存在,那不是也等于白解析一遍么?这跟从左往右,找到最里层,没有找到,有什么区别呢?
用一个哲学来解释:人可以选择2条路,而走的时候,只能走一条。在任何熟悉或阅读信息的书籍或报纸或代码时,都是一行一行的。从章节角度看,类似一个treeview....单向树...;你要从右往左匹配也是可以做到的,但没人那么写算法...Sunday算法号称急快速字符串匹配,如果把现有的好多规范弄成从右往左,目测,执行效率会快很多。
已有帐号?
无法登录?
社交帐号登录

我要回帖

更多关于 左边一个火右边一个昱 的文章

 

随机推荐