如何设计重叠按钮?

时间:2017-06-15 12:36:26

标签: html css responsive google-web-designer

[图像有设计] [1]图像描述了我想要的设计。我试过的是,我把三个按钮放在一起,试着把z-index,位置绝对,相对, 但没有用。

https://i.stack.imgur.com/7OxFO.png

我试过的代码是,我已经将三个按钮组合在一起:  123

我得到的东西看起来像这样[这是我制作的图像]  https://i.stack.imgur.com/ruxL5.png

1 个答案:

答案 0 :(得分:0)

请参阅此示例。回家你得到了你想要的东西。  http://embed.plnkr.co/ExU03A42KNqr6XakFo4I/

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="style.css">
    <script src="script.js"></script>

  <style>
    button{
      width:120px;
      height:40px;
      margin:-5px;
      background:#ee5353;
      border:1px solid gray;
      border-radius:3px;
    }
    button:nth-child(2){
      height:60px;
      position:relative;z-index:2;
    }
  </style>
</head>
  <body>
   <button>1</button>
   <button>2</button>
   <button>3</button>

  </body>

</html>
相关问题