用于CSS margin和padding速记属性的顺序的助记符 [英] A mnemonic for the order of CSS margin and padding shorthand properties
问题描述
我永远不会记得在一个声明中设置边距或填充的速记属性的顺序。也就是:
I can never remember the order of the shorthand property for setting the margin or padding in one declaration. That is:
margin-top: 2px;
margin-bottom: 4px;
margin-left: 3px;
margin-right: 8px;
可以写为
margin: 2px 8px 4px 3px;
是的我明白,可以想象一个时钟,从中午开始,顺时针。但我一直忘记这一点。
Yes I understand that one can visualise the order by thinking of a clock, starting at midday and moving clockwise. But I keep forgetting about that. I need to recall the order top, right, bottom, left textually.
因此, TBLR TRB L。
像这个[R-noun] [B-verb] [L-nouns]可能是去的路,但我觉得自己缺乏灵感。如果任何人遇到一个有用的助记符,我很想听到它。像一个好的模因,我相信一旦我收到的东西寄存在我的大脑,我不太会忘记它。
Something like This [R-noun] [B-verb] [L-nouns] is perhaps the way to go but I feel myself lacking inspiration. If anyone has come across a useful mnemonic for this I'd love to hear it. Like a good meme, I'm sure once I get something lodged in my brain I will be unlikely to forget it.
注意:问题提供的信息不正确 - 订单(如某些意见和答案中所述)为右上左下。 (heh,看我的意思? - dland)
NOTE: This question gave incorrect information - the order (as noted in some of the comments and answers) is Top Right Bottom Left. (heh, see what I mean? -- dland)
推荐答案
如果你不正确,会有TRouBLe
If you don't get it right, there will be TRouBLe
这篇关于用于CSS margin和padding速记属性的顺序的助记符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!