A cool looking box

2018-05-15 17:26 更新
先決條件: 在嘗試此評(píng)估之前,您應(yīng)該已經(jīng)完成了本單元中的所有文章。
目的: 測(cè)試CSS框模型的理解,以及其他框相關(guān)的功能,如邊框和背景。

初始點(diǎn)

要開(kāi)始評(píng)估,您應(yīng)該:

  • Make local copies of the starting HTML and CSS — save them as index.html and style.css in a new directory.

注意:或者,您也可以使用 JSBin "https://thimble.mozilla.org/"class ="external-icon external"> Thimble 來(lái)做你的評(píng)估。 您可以粘貼HTML并將CSS填入其中一個(gè)在線編輯器。 如果您使用的在線編輯器沒(méi)有單獨(dú)的CSS面板,請(qǐng)隨意將其放在文檔頭部的< style> 元素中。

工程概要

你的任務(wù)是創(chuàng)建一個(gè)酷的,奇特的盒子,并探索我們可以有什么有趣的CSS。

一般任務(wù)

  • Apply the CSS to the HTML.

為盒子造型

我們希望您對(duì)所提供的 。"> < p> ,并提供以下內(nèi)容:

  • A reasonable width for a large button, say around 200 pixels.
  • A reasonable height for a large button, centering the text vertically in the process.
  • Centered text.
  • A slight increase in font size, to around 17-18px computed style. Use rems. Write how you worked the value out in a comment.
  • A base color for the design. Give the box this color as its background color.
  • The same color for the text; make it readable using a black text shadow.
  • A fairly subtle border radius.
  • A 1 pixel solid border with a color similar to the base color, but a slightly darker shade.
  • A linear semi-transparent black gradient that goes towards the top left corner. Make it completely transparent at the start, gradiating to around 0.2 opacity by 30% along, and remaining at the same color until the end.
  • Multiple box shadows. Give it one standard box shadow to make the box look slightly raised off the? page. The other two should be inset box shadows — a semi transparent white shadow near the top left and a semi transparent black shadow near the bottom right, to add to the nice raised 3D look of the box.

例子

以下屏幕截圖顯示了完成的設(shè)計(jì)可以是什么樣子的示例:

>

評(píng)定

如果您作為有組織課程的一部分參加此評(píng)估,您應(yīng)該能夠?qū)⒛墓ぷ鹘唤o您的老師/導(dǎo)師進(jìn)行標(biāo)記。 如果您是自學(xué)習(xí)的,那么您可以輕松地通過(guò) dev-mdc 郵件列表,或者在 #mdn IRC頻道中。 org / IRC"class ="external"> Mozilla IRC 。 嘗試練習(xí)第一 - 沒(méi)有什么可以通過(guò)作弊獲得!

以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)