一天苹果...
#css #网络开发人员 #watercooler #joke

他们说,每天一个苹果使医生远离...但是这也适用于网络开发和CSS吗? Today’s cartoon tried to answer that question

Cartoon with the title 'They say an apple a day keeps the doctor away... but the CSS Developer :has more faith in a margin'. A man doing yoga, his personal space highlighted with a border. There's a bubble with the CSS code: ':has(.doctor) #me { margin: 15vmin; }' And at a distance, there's an angry doctor who can't get closer.

在HTML和CSS中编码动画片时,您可以检查source code at this live demo on comicss.art

选择

我还编码了一个替代版本,更有教育意义,使用相同的图纸突出显示了框模型的各个部分(希望个人空间的想法很清楚...我知道这可能不明显...)< /p>

'An apple a day may keep the doctor away... But a CSS developer trusts the box model'. A cartoon with a man doing yoga with a dashed line showing his personal space, a bubble with the CSS code ':has(.doctor) #me { margin: 15vmin; }', and an angry doctor complaining he can't get closer. The person doing yoga is labeled as 'content', the space between the person and the dashed line is 'padding', the dashed line is labeled 'border', the space between the dashed line and the doctor is 'margin'

希望这很清楚。尽管我必须承认,标记个人空间的虚线有点怪异,这可能会令人困惑(因为这似乎是一个力场,而边界实际上是在人和边界之间而不是在边界之间和医生。)