】。"/> 】。">

首頁  >  文章  >  web前端  >  css為圖片添加浮水印

css為圖片添加浮水印

王林
王林轉載
2020-10-26 16:13:154692瀏覽

css為圖片添加浮水印

目的:

為一些圖片加上浮水印。

(學習影片推薦:css影片教學

圖片與浮水印展示區

<div class="watermark-image"></div>

樣式

.watermark-image {
  position: relative;

  width: 300px;
  height: 300px;

  background: url(&#39;https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1489746806388&di=68436cfc9319b2f3afeffa9a984a2dc2&imgtype=0&src=http%3A%2F%2Fimg5.duitang.com%2Fuploads%2Fitem%2F201605%2F19%2F20160519224441_VfMWR.thumb.700_0.jpeg&#39;) no-repeat;
  background-size: 300px;

  border: 1px dotted #f00;
}

.watermark-image:before {
  content: "Message here.";
  font-size: 21pt;

  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -80px;

  background-color: rgba(255, 255, 0, 0.7);
  -webkit-transform:rotate(-45deg);
}

相關推薦: CSS教學

#

以上是css為圖片添加浮水印的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:csdn.net。如有侵權,請聯絡admin@php.cn刪除
上一篇:css樣式重置下一篇:css樣式重置