农民约翰是一个惊人的会计

It had been two years and John had no job.

已经两年了,约翰没有工作。

John was a smart 20-something guy. Okay, he had a job — but it wasn’t one he liked. It was too monotonous and was not nearly creative enough. His day job only bored the hell out of him.

约翰是个聪明的20多岁的家伙。 好的,他有一份工作-但这不是他喜欢的工作。 这太单调了,还不够有创意。 他的日常工作只会使他无聊。

求职 (The Job Search)

For John, it felt as though it wasn’t difficult to learn to code. He taught himself to code, and started looking for the opportunity to leave his boring job — finally.

对于John来说,感觉好像并不难学习编码。 他自学了编码,并开始寻找机会离开无聊的工作-终于。

After a month of futile job searching, he got a call from Sharon.

经过一个月的徒劳寻找工作,他接到了沙龙的电话。

Sharon was the recruiter for youknowho Inc, an AI startup in the valley.

沙龙曾是位于山谷的AI初创公司youknowho Inc的招聘人员。

With a lot of enthusiasm, John blazed through all the hiring process. Guess what the interesting part was?

约翰满怀热情地完成了整个招聘过程。 猜猜有趣的部分是什么?

That call from Sharon.

沙龙的那个电话。

She asked a couple questions on his background, and John couldn’t wait to share his boring, monotonous typical work day with her.

她问了几个有关他的背景的问题,约翰迫不及待地想与她分享他无聊,单调的典型工作日。

He tried to tell himself that it didn’t matter if he got the Job. At least, those were the words he muttered as the call ended. I just had to share how I really felt about my current Job, he said.

他试图告诉自己,是否得到这份工作并不重要。 至少这些是通话结束时他喃喃自语的话。 我只是分享如何我真的觉得对我现在的工作,”他说。

Weeks went by, and it felt like a dream when got himself a job as a junior frontend developer.

几周过去了,当自己担任初级前端开发人员的工作时,这就像一个梦。

And that’s where the story begins.

这就是故事的开始。

John遇到Khalid和CSS网格 (John meets Khalid and the CSS Grid)

Khalid wasn't a DJ.

哈立德不是DJ。

If he were, then all he mixed was clean code, and not songs.

如果他是,那么他所混合的只是干净的代码,而不是歌曲。

If you wanted to ruin a nice afterparty, then have Khalid be your DJ. You’d get nothing short of a complete mess.

如果您想破坏一场美好的派对,那么请让哈立德(Khalid)做您的DJ。 您将一团糟。

Khalid wasn't a big fan of songs anyway, but who needs to love music when you’re tech lead at a thriving Startup in the Valley?

无论如何,哈立德(Khalid)都不是歌迷,但是当你在硅谷蓬勃发展的创业公司担任技术主管时,谁会喜欢音乐?

As tech lead, Khalid was responsible for the entire development team. This meant more than just dealing with technical issues — it also meant he had to deal with people from different backgrounds.

作为技术主管,Khalid负责整个开发团队。 这不仅意味着要处理技术问题,还意味着他必须与来自不同背景的人打交道。

And that’s a darn hard thing to suceed at. But Khalid excelled not just at being a great technical leader. He had an impeccable relationship with the development team.

这是一件很难的事情。 但是Khalid不仅擅长成为一名出色的技术领导者。 他与开发团队有着无可挑剔的关系。

It wasn't a surprise that the two got talking almost immediately. Who wouldn't love John?

这两个人几乎立即开始交谈并不奇怪。 谁会不爱约翰?

His broad smiles were enough to light up a tunnel. He just smiled always. Who does that!

他灿烂的笑容足以照亮隧道。 他只是一直微笑。 谁做的!

回到办公室 (Back at the office)

Everyone was ready for work.

每个人都准备工作。

John entered with a cup of coffee. It was morning, and the office had just started to buzz.

约翰带着一杯咖啡进来了。 那天早上,办公室刚开始嗡嗡作响。

Good Monday morning, eh?

星期一早上好,是吗?

“So, John it is nice to have you join the development team. Was wondering if you were ready to take on a new task today?” asked Khalid

“所以,约翰,很高兴您加入开发团队。 想知道您今天是否准备好承担一项新任务?” 哈立德问

“Hey, boss. I was born ready! ”

“嘿,老板。 我天生就准备好了! ”

That’s John for you. He was born ready — indeed. Happy dude.

那是约翰给你的。 他天生就准备好了-的确如此。 老兄

“Umm, I need you to set up a new landing page for our new product. And we want it written with the CSS Grid. Ever heard of it?”

“嗯,我需要您为我们的新产品设置一个新的登录页面。 我们希望它使用CSS Grid编写。 听说过吗?”

“Oh yes I have,” John said quickly.

“哦,是的,”约翰Swift说道。

学习CSS网格 (Learning the CSS Grid)

John had no idea what the CSS Grid was.

John不知道CSS网格是什么。

The only reason he said yes was that he didn't want to look stupid in front of Khalid.

他唯一同意的理由是,他不想在哈立德面前显得愚蠢。

He searched on Medium and found great CSS Grid articles. He read to his heart’s content, and started working on the layout.

他在Medium上搜索,找到了很棒CSS Grid文章。 他认真阅读了内容,并开始进行版式设计。

约翰建立的布局 (The layout John built)

John had a lot of experience with Bootstrap.

约翰在Bootstrap上有很多经验。

He was quite familiar with the concept of a 12-column grid. So, with the CSS Grid, the first thing he did was set up a 12 column grid like so:

他对12列网格的概念非常熟悉。 因此,对于CSS网格,他所做的第一件事是建立一个12列网格,如下所示:

grid-template-columns: repeat(12, 1fr)

“Haha, that was easy,” he thought to himself.

“哈哈,那很容易,”他自言自语。

In fact, John did this for every side project he worked on while learning the CSS Grid.

实际上,John在学习CSS网格时为他从事的每个副项目都做了此工作。

John enjoyed working with the CSS Grid, and he thought it was fun.

John喜欢使用CSS Grid,他认为这很有趣。

He made a few mistakes, and some stuff didn't work as he expected, but he was able to quickly fix the issues.

他犯了一些错误,有些东西没有达到他的预期,但是他能够Swift解决问题。

He knew how to Google things. In this day and age, everyone should.

他知道如何Google的东西。 在这个时代,每个人都应该。

与哈立德的会面 (The meeting with Khalid)

“I’ve got it working now, Boss.”

“我现在已经开始工作了,老板。”

Khalid was excited to see John. They chatted about his experience building the layout, and Khalid went on to take a look at the code.

哈立德很高兴见到约翰。 他们聊起了他构建布局的经验,然后Khalid继续看了一下代码。

Well, every layout built with the CSS Grid pretty much begins with the grid definition. So, that was where Khalid looked first.

嗯,使用CSS Grid构建的每个布局几乎都始于网格定义。 因此,这就是Khalid的第一眼。

“Oh, man. There’s something not right here.”

“天啊。 这里有些不对劲。”

为什么创建12列? (Why did you create 12 columns?)

And Khalid began his lecture …

哈立德开始他的演讲……

12 column grids are popular in web design today. But the idea behind the CSS Grid is to create the number of columns you need without bloating the layout with columns you don’t really need.

12个列网格在当今的网页设计中很流行。 但是CSS网格背后的想法是创建所需的列数,而不会用不需要的列来使布局膨胀。

The CSS Grid layout forces you to think about layouts in CSS a little differently than we’ve done for over 20 years.

CSS网格布局迫使您对CSS布局的思考与我们20多年来所做的稍有不同。

It is a game changer, one that includes a lot of unlearning.

它是一个改变游戏规则的人,其中包括很多未学习的知识。

“A neater approach would have been to create the 2 or 3 columns you needed and just get on with the design,” said Khalid.

Khalid说:“更巧妙的方法是创建所需的2或3列,然后继续进行设计。”

“There’s no harm in redefining the number of columns within the media query too. Makes it perfect for responsive design.”

“重新定义媒体查询中的列数也没有害处。 使其非常适合响应式设计。”

课程 (The lesson)

With the CSS Grid layout, you aren’t bound to a set number of rows or columns.

使用CSS Grid布局,您不必绑定到一定数量的行或列。

You also don’t have to create 12 columns every time. If you don’t need 12 columns, don’t create them. The CSS Grid isn’t another grid based CSS framework.

您也不必每次都创建12列。 如果不需要12列,则不要创建它们。 CSS网格不是另一个基于网格CSS框架。

You’re free.

你自由了。

As pointed out by Per Harald Borgen, you may create 12 columns if you want to experiment with white spaces between columns.

正如Per Harald Borgen指出的那样,如果您要尝试在列之间使用空白,则可以创建12列。

Other than that, create the number of columns you really need, and get on with the design.

除此之外,创建您真正需要的列数,然后继续进行设计。

使用CSS网格布局可以使网络向前发展 (Using the CSS Grid layout moves the web forward)

I read an answer to why Apple keeps getting rid of things, instead of adding them.

我读了一个答案 ,解释了为什么Apple不断摆脱事物而不是添加事物。

There, I learned this:

在那里,我学到了这一点:

“Supporting legacy is not always the best answer. Dropping things helps the industry move forward to adopt newer, better, formats.”

“支持传统并不总是最好的答案。 放下东西可以帮助行业向前迈进,采用更新,更好的格式。”

In the same way, choosing to learn and use the CSS Grid advances the web. It helps the industry embrace newer and better formats. It helps us grow as a community. A community we so love, and want to grow.

以同样的方式,选择学习和使用CSS Grid可以使网络发展。 它可以帮助行业采用更新更好的格式。 它帮助我们成长为一个社区。 我们热爱并希望成长的社区。

Be like Khalid. Start using the CSS Grid if you can.

像哈立德一样。 如果可以,请开始使用CSS网格。

Where possible, invest in a decent CSS Grid education. You’ll be helping to move the web forward.

在可能的情况下,投资进行体面CSS Grid教育。 您将帮助推动网络向前发展。

想成为专业人士吗? (Want to become a Pro?)

Download my free CSS Grid cheat sheet, and also get two quality interactive Flexbox courses for free!

下载我的免费CSS Grid备忘单,并免费获得两本优质的交互式Flexbox课程!

Get them now ?

立即获取 ?

翻译自: https://www.freecodecamp.org/news/my-friend-john-made-a-mistake-in-css-grid-dont-be-like-john-do-this-instead-91649f480da1/

农民约翰是一个惊人的会计

农民约翰是一个惊人的会计_我的朋友约翰在CSS Grid中犯了一个错误。 不要像约翰-这样做。相关推荐

  1. 使用css选择器容易犯的一个小错误

    使用css选择器容易犯的一个小错误 比如说,当我们使用scrapy框架的时候,想要利用find_element_by_css_selector()方法来找出网页中对应的部分,比如说下图所示的登陆框. ...

  2. matlab如何截取图像的中间部分_利用matlab提取并分割RGB图像中的某一个已知像素值的图像...

    已知一副RGB图像中的的像素值,利用matlab将其分割出来并以二进制图像形式显示: %extract.m clear all; I=imread('new_original.png'); figur ...

  3. figma下载_我如何使用Figma,CSS Grid和CSS Flexbox构建登录页面

    figma下载 I enjoy looking at website designs that are on platforms like Behance, Dribble, etc. as they ...

  4. php 数组指向下一个值,比较数组值并根据自定义值(PHP)在数组中查找下一个值 - php...

    我正在尝试比较数组中的值,然后根据所选值在数组中选择下一个值. 例如 array(05:11,05:21,05:24,05:31,05:34,05:41,05:44,05:50,05:54); 如果搜 ...

  5. java做一个客房管理系统定制_管理皮孩子很难?来,教你一个java设计简单的学生管理系统...

    前言: 孩子不听话,那就系统的管理起来,啊哈哈哈哈 学生成绩管理系统 要求: 完善Student类,Student类包含学号.姓名.年级.专业.三门功课的成绩(英语.高数.计算机)的成员变量,完善成绩 ...

  6. oracle 查询过去一个星期的数据_过去一星期,最懂我的居然是一个表情包

    文/黄亚男 编辑/大风 微信表情包上新快一周了,除了各个聊天对话框.朋友圈,蔓延到了其它社交平台. 小黄脸表情伴随着微信的诞生和升级,迄今在微信上已经四次更新.每一次几乎有一个出圈的表情:第一次是&q ...

  7. 如何初始化局部变量c语言_【C语言更新】C语言中如何来定义一个指针,并且对其进行初始化...

    文/Edward上一节中,我们利用了一个小知识来介绍了一下指针,在上面这个例子中,小明和小丽手中的这个杯子就好比我们C语言中的变量,它确实是实实在在存放一些有具体意义的数据.这个杯套就类似于C语言中指 ...

  8. svg配合css3动画_与Sarah Drasner一起使用CSS,JS和SVG进行动画处理,并避免倦怠

    svg配合css3动画 In this episode of the Versioning Show, Tim and David are joined by Sarah Drasner, a tea ...

  9. vscode vue解决跨域_在vs code 中如何创建一个自己的 Vue 模板代码

    首先,在vs code 中打开定义模板代码的地方 第一步,点击"设置"图标按钮,在弹出的菜单中点击的"用户代码片段"(也就是模板) 第二步,在弹出的框中选择新建 ...

最新文章

  1. 清华大学:2021 元宇宙研究报告!
  2. 关于equals与hashcode的重写
  3. 初涉SQL Server性能问题(3/4):列出阻塞的会话
  4. 2020年人工神经网络第二次作业-参考答案第五题
  5. 绘制网络拓扑图的素材
  6. Notepad++ NppExport: 让你在Microsoft word 中粘贴语法高亮代码
  7. 三十九、Vue项目上手 | 用户管理系统 实现添加用户功能(中篇)
  8. 述职答辩提问环节一般可以问些什么_每个优秀的人都会被看到述职晋升季buff大推送...
  9. Math.abs为Integer.Min_VALUE返回错误的值
  10. 流式数据分析_流式大数据分析
  11. Qt532.线程(_beginthread)
  12. 点击select下拉框获取option的属性值
  13. ES 集中式日志分析平台 Elastic Stack(介绍)
  14. git commit撤销_Git commit 提交一堆记录?试试撤回 commit 操作,你会爱上它
  15. (转) Hibernate持久化类与主键生成策略
  16. 华为交换机几种端口属性
  17. android swf游戏下载工具,swf游戏模拟器高级版下载
  18. 手写数字识别神经网络,手写体识别 神经网络
  19. 计算机开机了进入不到桌面,电脑开机后进不了桌面,小编教你电脑开机后无法进入桌面怎么办...
  20. linux下退出mysql

热门文章

  1. Redis面试复习大纲在手面试不慌,内含福利
  2. 从草根到百万年薪程序员的十年风雨之路,使用指南
  3. SpringBoot项目打war包部署Tomcat教程
  4. MySQL运算符优先级顺序
  5. attr与prop的区别
  6. ASP.Net 获取服务器信息
  7. 安全公司笔试面试题总结
  8. [导入]VB PE导出/输入表演示(读文件版)
  9. 为什么要用Redis
  10. ON DUPLICATE KEY UPDATE