当伪元素用于父div时按钮不起作用

时间:2016-09-30 07:30:39

标签: javascript css3

当伪元素用于父元素时,

按钮不起作用 请帮助我在下面的js小提琴演示我的作品: https://jsfiddle.net/uv5u5rLk/

<div class="slide_wrapper">
    <!--Slide_area_start-->
<div class="slide_area ">
        <!--Slide_content_area_start-->
<div class="slide_content_area clearfix">
            <h1>Welcome to KBC</h1>
            <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.</p>
<input type="button" class = "slide_content_button btn" >
<div class="slide_content_button btn" ><a href="#">Know More</a>      </div>
        </div>
        <!--Slide_content_area_end-->
</div>
    <!--Slide_area_end-->
</div>

2 个答案:

答案 0 :(得分:1)

只需将z-index中的.slide_area更改为z-index:1

请勿使用z-index:-1

DEMO

答案 1 :(得分:0)

你是什​​么意思?什么尝试用你的按钮链接你的js代码

如果你想用php获取服务器端的输入值,例如你需要输入

<form method="your method" action="your action">


    <input name="yournameInput" ></input>
    <input name="yournameInput" ></input>
    <button id="mybtn" type="subcribe"></button>

</form>

将在您的表单操作上进行描述

现在如果你想修改客户端使用js

<script>
  var btn = document.getElementById('mybtn');
  btn.addEventListener('click', function(evt){
    evt.preventDefault();
    // your action
  });

</script>

sory表示没有用,但你的问题不明确