M
M
Maxim Tyulpakov2015-11-10 23:11:18
css
Maxim Tyulpakov, 2015-11-10 23:11:18

How to make a shadow not on all sides?

I made buttons on CSS + HTML now I don’t know how to deal with shadows.
Here is the code for the last banner:

<div id="button04"><br><br>ЛЮБЫЕ ФОРМЫ ОПЛАТЫ
    <div id="s_panel04">
      <p> <br>наличные<br>электронные<br>карты<br>кредит</p>
    </div>
  </div>

#button04 {
  position: fixed;
  top: 610px;
  left: 0;
  background: #666699;
  width: 100px;
  height: 110px;
  color: #fff;
  border-top:3px solid white;
  border-bottom:3px solid white;
  border-right:3px solid white;
  box-shadow:5px 5px 30px gray;
  text-align: center;
  -webkit-transition-duration: 0.3s;
  -moz-transition-duration: 0.3s;
  -o-transition-duration: 0.3s;
  transition-duration: 0.3s;
  -webkit-border-radius: 0 5px 5px 0;
  -moz-border-radius: 0 5px 5px 0;
  border-radius: 0 60px 60px 0;
  }
#s_panel04 {
  position: fixed;
  top: 610px;
  left: -150px;
  background: #666699;
  width: 150px;
  height: 110px;
  box-shadow:5px 5px 30px gray;
  border-top:3px solid white;
  border-bottom:3px solid white;
  -webkit-transition-duration: 0.3s;
  -moz-transition-duration: 0.3s;
  -o-transition-duration: 0.3s;
  transition-duration: 0.3s;
  }
#button04:hover {
  left: 150px;
}
#button04:hover #s_panel04 {
  left: 0;
}

35ee0aa1bf5e4cd1b4cc78adc0107493.PNG
how to get rid of this shadow in the center of the banner?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
rmaksim, 2015-11-10
@MaXComp

leave shadows only for the button and padding the button for the width of the panel
resp. move it to the left by the same width
and remove the shadows and background from the panel altogether
, something like this jsfiddle.net/nrao4bub
update : oh, markup was added - then like this jsfiddle.net/nrao4bub/1

A
Alexander Pupkin, 2015-11-10
@sakrab

www.cssmatic.com/box-shadow

A
Alexey Lebedev, 2015-11-10
@swanrnd

codepen.io/iiil/pen/FAqjn something like this

S
Sergey Goryachev, 2015-11-11
@webirus

The z-index for the left box is larger than the right box to cover the shadow.
And a little higher there was advice to make padding, also an option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question