测量em单位 [英] Measuring em units

查看:70
本文介绍了测量em单位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好


我已经开始在过去几周内更多地使用CSS了,在最后一周我已经开始使用em了单位。我下载了哪些统治者

可以用em单位显示测量值,还是有另一种方式以简单的方式显示em单位的图形表示。


我知道一个em单元是基于网页

主体中默认字体的大小而且我一直在放置临时彩色边框

容器可以直观地显示它们的样子

不同的测量值但是我在试用时浪费了很多时间和

这样做是错误的。


我使用em单位的主要灵感来自于更多Eric Meyer on

CSS这本书。作者:Eric Meyer(特别是关于css下拉菜单的章节)

和Mulder在Web Monkey的样式表教程。


谢谢


Peter Mount
in**@petermount.au.com

推荐答案

Peter Mount写道:
Peter Mount wrote:
你好

我在上一对夫妇中开始使用CSS了几个星期以及在最后一周我开始使用em单位。我下载的统治者是否可以用em单位显示测量结果,或者是否有其他方式以简单的方式显示em单位的图形表示。

我知道一个em单位是基于网页
主体中默认字体的大小
Hello

I''ve started using CSS more in the last couple of weeks and in the last
week I''ve started using em units. Are there any rulers I download that
can show measurements in em units or is there another way of showing a
graphical representation of em units in a simple manner.

I know that an em unit is based on the size of the default font in the
body of the web page




"''em''单位是相等的到使用它的元素的''font-size''

属性的计算值。


来自:
http:// www .w3.org / TR / CSS21 / syndata.h ... lue-def-length


Peter Mount< in ** @ petermount.au .COM>写道:
Peter Mount <in**@petermount.au.com> wrote:
我已经开始在过去几周内更多地使用CSS了,在上周我已经开始使用em单位了。


你正在取得很大的进步。很多人在多年之后才能达到启蒙价格,或者永远不会达到


是否有任何我可以下载的统治者可以用em单位显示测量结果还是有另一个<以简单的方式显示em单元的图形表示的方式。


您可以用em单位设置元素的尺寸并使用边框

使尺寸可见。您也可以设置背景颜色。

以下显示1em乘1em方形(着名的em广场 - 但确切地说是
,边框不是广场的一部分,只有内容是):

< div style =

" width:1em;身高:1em; line-height:1; border:solid black 1px">< / div>

我知道em单位是基于网页正文中默认字体的大小


不,em单位表示_current_字体的字体大小,在您使用单位的元素中使用的字体

- 除了字体大小

属性,其中em单位表示封闭(父)

元素的字体大小。 (对于

字体大小的属性,使用em单元没有什么意义!)

我已经放置了临时彩色
边框在容器中使用不同的测量值来直观地表示它们看起来像什么但是我正在浪费大量的时间进行试验和错误这样做。
I''ve started using CSS more in the last couple of weeks and in the
last week I''ve started using em units.
You''re making great progress. Many people reach that enlightenment only
after years, or never!
Are there any rulers I
download that can show measurements in em units or is there another
way of showing a graphical representation of em units in a simple
manner.
You can set the dimensions of an element in em units and use a border to
make the dimensions visible. You might also set background color. The
following shows a 1em by 1em square (the famous em square - but to be
exact, the borders are not part of the square, only the content is):
<div style=
"width: 1em; height: 1em; line-height: 1; border: solid black 1px"></div>
I know that an em unit is based on the size of the default font in
the body of the web page
No, the em unit means the font size of the _current_ font, the font used
in the element for which you use the unit - except for the font-size
property, where the em unit means the font size of the enclosing (parent)
element. (There would be little point in using the em unit for the
font-size property otherwise!)
and I''ve been placing temporary coloured
borders in containers to get a visual representation of what they
look like with different em measurements but I''m wasting a lot of
time with trial and error doing it that way.



我不确定我明白为什么你认为这是浪费。如果你试图让大小的东西与

像素中的一些先入为主的布局相匹配,而不是简单地用em单位设计,那么可能是浪费,因为

印刷工作者传统上甚至在印刷世界中也是这样做的,其中的电子元件根本不像WWW那样灵活设置。


-

Yucca, http:// www .cs.tut.fi / ~jkorpela /


" Jukka K. Korpela" < JK ****** @ cs.tut.fi>写道:
"Jukka K. Korpela" <jk******@cs.tut.fi> writes:
Peter Mount< in ** @ petermount.au.com>写道:
Peter Mount <in**@petermount.au.com> wrote:
我下载了哪些可以在em />单位显示测量值的标尺,还是有另一种方式以简单的方式显示em单位的图形表示。
Are there any rulers I download that can show measurements in em
units or is there another way of showing a graphical
representation of em units in a simple manner.



您可以以em为单位设置元素的尺寸,并使用边框来确保尺寸可见。您也可以设置背景颜色。
以下显示1em乘1em广场(着名的em广场 - 但确切地说,边框不是广场的一部分,只有内容):
< div style =
" width:1em;身高:1em; line-height:1; border:solid black 1px">< / div>



You can set the dimensions of an element in em units and use a border to
make the dimensions visible. You might also set background color. The
following shows a 1em by 1em square (the famous em square - but to be
exact, the borders are not part of the square, only the content is):
<div style=
"width: 1em; height: 1em; line-height: 1; border: solid black 1px"></div>




outline:solid black 1px;我认为会把视觉优势放在正确的b
位置。不确定浏览器支持 - Opera支持它,我不知道Mozilla是否还没有确认。


-

Chris



outline: solid black 1px; would put the visual edge in the right
place, I think. Not sure about browser support - Opera supports it, I
don''t known if Mozilla does yet or not.

--
Chris


这篇关于测量em单位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆