CSS to achieve zoom in and out close button (example code)

CSS to achieve zoom in and out close button (example code)

This effect is most common on our browser page. Let me show you the effect picture first:

As shown in the figure above, use CSS to draw the above three buttons:

<template>
  <div class="windowAction">
    <button class="min">Zoom out</button>
    <button class="fullpage">Zoom in</button>
    <button class="close">Close</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      flag_fullpageWebView: 1
    };
  }
};
</script>

<style lang="scss" scoped>
.windowAction {
  margin-top: -5px;
  -webkit-app-region: no-drag;
  min-width: 70px;
  text-align: right;
  button {
    &:hover {
      color: #a8aabd;
    }
  }
  .min {
    width: 14px;
    height: 14px;
    background-color: transparent;
    font-size: 0;
    margin-right: 18px;
    position: relative;
    color: #878896;
    &:after {
      content: "";
      width: 100%;
      position: absolute;
      left: 0;
      bottom: 0;
      border-bottom: 2px solid;
    }
  }
  .fullpage {
    width: 16px;
    height: 16px;
    color: #878896;
    border: 2px solid;
    background-color: transparent;
    font-size: 0;
    margin-right: 18px;
  }
  .close {
    width: 18px;
    height: 18px;
    font-size: 0;
    background-color: transparent;
    position: relative;
    color: #878896;
    transform: rotate(45deg) translate(-2px, 2px);
    &:before,
    &:after {
      content: "";
      position: absolute;
    }
    &:before {
      width: 100%;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      border-top: 2px solid;
    }
    &:after {
      height: 100%;
      left: 50%;
      top: 0;
      transform: translateX(-50%);
      border-left: 2px solid;
    }
  }
}
</style>

Summarize

The above is the CSS implementation of zoom in, zoom out and close buttons introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

<<:  MySQL View Principle Analysis

>>:  Detailed steps to install docker in 5 minutes

Recommend

How to install PostgreSQL and PostGIS using yum on CentOS7

1. Update the yum source The PostgreSQL version o...

TinyEditor is a simple and easy-to-use HTML WYSIWYG editor

A few days ago, I introduced to you a domestic xh...

Detailed explanation of character sets and validation rules in MySQL

1Several common character sets In MySQL, the most...

Web front-end performance optimization

Web front-end optimization best practices: conten...

jQuery implements accordion small case

This article shares the specific code of jQuery t...

Tutorial on installing mysql5.7.17 via yum on redhat7

The RHEL/CentOS series of Linux operating systems...

What are inline elements and block elements?

1. Inline elements only occupy the width of the co...

Insufficient memory problem and solution when docker starts elasticsearch

question Insufficient memory when docker installs...

W3C Tutorial (2): W3C Programs

The W3C standardization process is divided into 7...

Example of using CSS3 to customize the style of input multiple-select box

Principle: First hide the input element, then use...

Should nullable fields in MySQL be set to NULL or NOT NULL?

People who often use MySQL may encounter the foll...

Use of Linux tr command

1. Introduction tr is used to convert or delete a...

JS cross-domain XML--with AS URLLoader

Recently, I received a requirement for function ex...

Several ways to connect tables in MySQL

The connection method in MySQL table is actually ...

Detailed tutorial on MySQL installation and configuration

Table of contents Installation-free version of My...