Home > Web Front-end > CSS Tutorial > add watermark to image with css

add watermark to image with css

王林
Release: 2020-10-26 16:13:15
forward
4837 people have browsed it

add watermark to image with css

Purpose:

Add watermarks to some pictures.

(Learning video recommendation: css video tutorial)

Picture and watermark display area

<div class="watermark-image"></div>
Copy after login

Style

.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);
}
Copy after login

Related recommendations: CSS tutorial

The above is the detailed content of add watermark to image with css. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:csdn.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template