![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm unclear as to how best to use what I'm terming the top-level CSS selectors, by which I mean selectors like *, html and body. I'm coming at this from trying to understand how best to set font sizes but I seem to have strayed into a broader question. Some CSS guides seem to suggest that a * declaration is good practice for any style sheet, primarily I suppose to set zero defaults for margin and padding for all other relevant selectors (if I've understood this aright), ie * {margin: 0; padding:0;} |
|
But then the general (not universal I know) recommended approach for font-sizing seems to be something like: html {font-size: 100%;} body {font-size: 62.5%;} The default is 100%. Some authors like to set 100% on body to get over a |
#3
| ||||||
| ||||||
|
|
I'm unclear as to how best to use what I'm terming the top-level CSS selectors, by which I mean selectors like *, html and body. |
|
I'm coming at this from trying to understand how best to set font sizes but I seem to have strayed into a broader question. |
|
Some CSS guides seem to suggest that a * declaration is good practice for any style sheet, primarily I suppose to set zero defaults for margin and padding for all other relevant selectors (if I've understood this aright), ie * {margin: 0; padding:0;} |
|
But then the general (not universal I know) recommended approach for font-sizing seems to be something like: html {font-size: 100%;} |
|
body {font-size: 62.5%;} |
|
Though having said this, is there any reason why: * {font-size: 100%;} couldn't replace the html rule? |
#4
| |||
| |||
|
|
Some CSS guides seem to suggest that a * declaration is good practice for any style sheet * {margin: 0; padding:0;} |
|
body {font-size: 62.5%;} |
#5
| |||
| |||
|
|
That's illegal in any civilized country. |
|
* {font-size: 100%;} small> and <big> will not have effect |
#6
| |||
| |||
|
|
* {font-size: 100%;} small> and <big> will not have effect Have you tested it? |
|
In which browser? |
#7
| |||
| |||
|
|
* {font-size: 100%;} small> and <big> will not have effect Have you tested it? I took it for granted that browsers don't get such a simple thing wrong. |
#8
| |||
| |||
|
|
I'm unclear as to how best to use what I'm terming the top-level CSS selectors, by which I mean selectors like *, html and body. I'm coming at this from trying to understand how best to set font sizes but I seem to have strayed into a broader question. |
|
Some CSS guides seem to suggest that a * declaration is good practice for any style sheet, primarily I suppose to set zero defaults for margin and padding for all other relevant selectors (if I've understood this aright), ie * {margin: 0; padding:0;} But then the general (not universal I know) recommended approach for font-sizing seems to be something like: html {font-size: 100%;} body {font-size: 62.5%;} I was then wondering if it was necessary to have rules for all three of *, html and body, but I presume that it wouldn't be sensible to set font-size within the * declaration to avoid unwitting effects on font-size inheritance (ie cascades of 90% multiplied together). Though having said this, is there any reason why: * {font-size: 100%;} couldn't replace the html rule? Sorry - this isn't a very specific question but I guess I was just wondering whether there was any web article that discussed the relative use of these 'top-level' selectors in more detail? JGD |
#9
| |||
| |||
|
|
On Fri, 11 Apr 2008, Jukka K. Korpela wrote: * {font-size: 100%;} small> and <big> will not have effect Have you tested it? I took it for granted that browsers don't get such a simple thing wrong. I'm sorry for the confusion. Obviously, I got such a simple thing wrong. I had made a quick-and-dirty test for the above and noticed different font sizes for <big> and <small>. |
#10
| |||
| |||
|
|
John Dann wrote: body {font-size: 62.5%;} Wrong, wrong, wrong!!! *Never* do this. There is a ridiculous practice out there of setting this tiny font-size on body, then making it larger for individual sections of a page, like 1.3em for content. It is *BAD*. |
![]() |
| Thread Tools | |
| Display Modes | |
| |