Add languages Russian, Arabic, Chinese, Portuguese (#18305)

This commit is contained in:
Beau Carnes
2018-10-10 18:03:03 -04:00
committed by mrugesh mohapatra
parent 09d3eca712
commit 2ca3a2093f
5517 changed files with 371466 additions and 5 deletions

View File

@ -0,0 +1,60 @@
---
id: 587d78b0367417b2b2512b08
title: Create a Media Query
challengeType: 0
videoUrl: ''
localeTitle: 创建媒体查询
---
## Description
<section id="description">媒体查询是CSS3中引入的一种新技术它根据不同的视口大小更改内容的显示。视口是用户在网页上的可见区域根据用于访问网站的设备而不同。媒体查询由媒体类型组成如果该媒体类型与显示文档的设备类型匹配则应用样式。您可以根据需要在媒体查询中包含尽可能多的选择器和样式。以下是媒体查询的示例当设备的宽度小于或等于100px时返回内容 <code>@media (max-width: 100px) { /* CSS Rules */ }</code>并且以下媒体查询返回内容时设备的高度大于或等于350px <code>@media (min-height: 350px) { /* CSS Rules */ }</code>请记住仅当媒体类型与正在使用的设备的媒体类型匹配时才应用媒体查询中的CSS。 </section>
## Instructions
<section id="instructions">添加媒体查询以便当设备的高度小于或等于800px时 <code>p</code>标签的<code>font-size</code>为10px。 </section>
## Tests
<section id='tests'>
```yml
tests:
- text: 当设备<code>height</code>小于或等于800px时您的<code>p</code>元素的<code>font-size</code>为10px。
testString: 'assert($("p").css("font-size") == "10px", "Your <code>p</code> element should have the <code>font-size</code> of 10px when the device <code>height</code> is less than or equal to 800px.");'
- text: 为<code>height</code>小于或等于800px的设备声明<code>@media</code>查询。
testString: 'assert(code.match(/@media\s*?\(\s*?max-height\s*?:\s*?800px\s*?\)/g), "Declare a <code>@media</code> query for devices with a <code>height</code> less than or equal to 800px.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<style>
p {
font-size: 20px;
}
/* Add media query below */
</style>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.</p>
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>

View File

@ -0,0 +1,57 @@
---
id: 587d78b1367417b2b2512b09
title: Make an Image Responsive
challengeType: 0
videoUrl: ''
localeTitle: 使图像响应
---
## Description
<section id="description">使用CSS响应图像实际上非常简单。而不是对元素应用绝对宽度 <code>img { width: 720px; }</code>您可以使用: <blockquote> img { <br>最大宽度100; <br>显示:块; <br>身高:自动; <br> } </blockquote> 100<code>max-width</code>属性会缩放图像以适合其容器的宽度,但图像的拉伸宽度不会超过其原始宽度。将<code>display</code>属性设置为block会将图像从内联元素默认值更改为其自身行上的块元素。 auto的<code>height</code>属性保持图像的原始宽高比。 </section>
## Instructions
<section id="instructions">添加<code>img</code>标记的样式规则,使其响应其容器的大小。它应该显示为块级元素,它应该适合其容器的整个宽度而不拉伸,并且它应该保持其原始的宽高比。 </section>
## Tests
<section id='tests'>
```yml
tests:
- text: 您的<code>img</code>标记的<code>max-width</code>设置为100
testString: 'assert(code.match(/max-width:\s*?100%;/g), "Your <code>img</code> tag should have a <code>max-width</code> set to 100%.");'
- text: 你的<code>img</code>标签应该有一个<code>display</code>设置阻止。
testString: 'assert($("img").css("display") == "block", "Your <code>img</code> tag should have a <code>display</code> set to block.");'
- text: 你的<code>img</code>标签的<code>height</code>应该设置为auto。
testString: 'assert(code.match(/height:\s*?auto;/g), "Your <code>img</code> tag should have a <code>height</code> set to auto.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<style>
</style>
<img src="https://s3.amazonaws.com/freecodecamp/FCCStickerPack.jpg" alt="freeCodeCamp stickers set">
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>

View File

@ -0,0 +1,56 @@
---
id: 587d78b1367417b2b2512b0c
title: Make Typography Responsive
challengeType: 0
videoUrl: ''
localeTitle: 使排版响应
---
## Description
<section id="description">您可以使用视口单元进行响应式排版,而不是使用<code>em</code><code>px</code>来调整文本大小。视口单位(如百分比)是相对单位,但它们基于不同的项目。视口单元相对于设备的视口尺寸(宽度或高度),百分比相对于父容器元素的大小。四个不同的视口单元是: <ul><li> <code>vw: 10vw</code>将是视口宽度的10</li><li> <code>vh: 3vh</code>将是视口高度的3</li><li> <code>vmin: 70vmin</code>将是视口较小尺寸高度与宽度的70</li><li> <code>vmax: 100vmax</code>将是视口较大尺寸高度与宽度的100</li></ul></section>
## Instructions
<section id="instructions"><code>h2</code>标记的<code>width</code>设置为视口宽度的80将段落的<code>width</code>设置为视口较小尺寸的75</section>
## Tests
<section id='tests'>
```yml
tests:
- text: 你的<code>h2</code>标签应该有80vw的<code>width</code> 。
testString: 'assert(code.match(/h2\s*?{\s*?width:\s*?80vw;\s*?}/g), "Your <code>h2</code> tag should have a <code>width</code> of 80vw.");'
- text: 你的<code>p</code>标签应该有75vmin的<code>width</code> 。
testString: 'assert(code.match(/p\s*?{\s*?width:\s*?75vmin;\s*?}/g), "Your <code>p</code> tag should have a <code>width</code> of 75vmin.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<style>
</style>
<h2>Importantus Ipsum</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus quis tempus massa. Aenean erat nisl, gravida vel vestibulum cursus, interdum sit amet lectus. Sed sit amet quam nibh. Suspendisse quis tincidunt nulla. In hac habitasse platea dictumst. Ut sit amet pretium nisl. Vivamus vel mi sem. Aenean sit amet consectetur sem. Suspendisse pretium, purus et gravida consequat, nunc ligula ultricies diam, at aliquet velit libero a dui.</p>
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>

View File

@ -0,0 +1,55 @@
---
id: 587d78b1367417b2b2512b0a
title: Use a Retina Image for Higher Resolution Displays
challengeType: 0
videoUrl: ''
localeTitle: 使用Retina图像获得更高分辨率的显示
---
## Description
<section id="description">使图像显示为“视网膜”(并为视网膜显示进行优化)的最简单方法是将其<code>width</code><code>height</code>值定义为原始文件的一半。以下是仅使用原始高度和宽度的一半的图像示例: <blockquote> &lt;风格&gt; <br> img {身高250px;宽度250px; } <br> &lt;/样式&gt; <br> &lt;img src =“coolPic500x500”alt =“最精彩的图片”&gt; </blockquote></section>
## Instructions
<section id="instructions"><code>img</code>标记的<code>width</code><code>height</code>设置为原始值的一半。在这种情况下,原始<code>height</code>和原始<code>width</code>都是200px。 </section>
## Tests
<section id='tests'>
```yml
tests:
- text: 你的<code>img</code>标签应该有100像素的<code>width</code> 。
testString: 'assert($("img").css("width") == "100px", "Your <code>img</code> tag should have a <code>width</code> of 100 pixels.");'
- text: 你的<code>img</code>标签应该有100像素的<code>height</code> 。
testString: 'assert($("img").css("height") == "100px", "Your <code>img</code> tag should have a <code>height</code> of 100 pixels.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='html-seed'>
```html
<style>
</style>
<img src="https://s3.amazonaws.com/freecodecamp/FCCStickers-CamperBot200x200.jpg" alt="freeCodeCamp sticker that says 'Because CamperBot Cares'">
```
</div>
</section>
## Solution
<section id='solution'>
```js
// solution required
```
</section>