What is best replacement for in CSS?

后端 未结 3 1020
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 15:07

I am working on updating an old website which uses font tags, to use CSS. The old HTML uses numeric font sizes (1-7) like this:

Some text         


        
3条回答
  •  萌比男神i
    2021-02-05 15:27

    There is no defined mapping in approved specifications. HTML specifications do not say that what the values in mean; they are just a browser-dependent scale of sizes (and could all map to a single size). Similarly, CSS specifications do not define the meanings of font-size keyword values as absolute sizes or in HTML terms.

    HTML5 CR, which is work in progress, suggests a specific mapping, except that it does not define the CSS counterpart of xxx-large; it just describes it as being a value that “is a non-CSS value used here to indicate a font size 50% larger than 'xx-large'”.

    It is generally not useful to look for the mapping. For legacy pages, which might rely on some specific values for font size, just let them be. There is no point in trying to modernize them, e.g. by switching from presentational HTML to CSS. For new pages, the crucial question is what font sizes suit your needs, and for them, you had better forget entirely.

提交回复
热议问题