html 图像上的文字/ Testo sopra immagine - Fonte:http://codepen.io/chriscoyier/pen/myPMGB

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 图像上的文字/ Testo sopra immagine - Fonte:http://codepen.io/chriscoyier/pen/myPMGB相关的知识,希望对你有一定的参考价值。

@import url(http://fonts.googleapis.com/css?family=Roboto:400,900);

.module {
  background: 
    linear-gradient(
      rgba(0, 0, 0, 0.6),
      rgba(0, 0, 0, 0.6)
    ),
    url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/3/skyscrapers.jpg);
  background-size: cover;
  width: 300px;
  height: 200px;
  margin: 10px 0 0 10px;
  position: relative;
  float: left;
}

.top h2 {
  color: white;
  margin: 0;
  padding: 20px;
}

.lr p {
  font-family: 'Roboto', sans-serif;
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: white;
  margin: 0;
}

.mid h2 {
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  color: white;
  text-transform: uppercase;
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 2rem;
  transform: translate(-50%, -50%);
}

.cap p {
  padding: 20px;
  color: white;
  font: 12px Monaco, Mono-Space;
  margin: 0;
}
<div class="module top">
  <h2>Skyscrapers</h2>
</div>

<div class="module mid">
  <h2>Skyscrapers</h2>
</div>

<br style="clear: both;">

<div class="module cap">
  <p>Skyscraper are really neat and stuff because they are tall.</p>
</div>

<div class="module lr">
  <p>Skyscrapers sometimes have nicknames like jim or shim.</p>
</div>

以上是关于html 图像上的文字/ Testo sopra immagine - Fonte:http://codepen.io/chriscoyier/pen/myPMGB的主要内容,如果未能解决你的问题,请参考以下文章

如何阅读写在图像上的文字?

CSS 内嵌图像上的文字

HTML5 Canvas:图像上的文本绘制在图像更改时停止显示

C# html 电子邮件 - 图像上的 Div/文本

php Testo Bottone Pagina Prodotto

css Nascondere il testo ACCANTO