2017-02-04 35 views
0

My Form我怎么能像一个隐藏我的信的软底?

我怎么能做出这样的软端隐藏我的信(其中“d”这就像被截断;我希望它像一个梯度)

THX:d

编辑:

HTML:

<form action="" method="GET" class="buscar_form"> 
    <input type="text" name="buscar" id="buscar_form_input_text"> 
</form> 
+2

你的html和css在哪里? –

回答

1

.test { 
 
    background-color: rgb(102, 51, 153); 
 
    padding: 20px; 
 
    font-size: 2em; 
 
    color: white; 
 
    font-family: sans-serif; 
 
    position: relative; 
 
} 
 

 

 

 
.test:after { 
 
    content: ''; 
 
    position: absolute; 
 
    top: 0; 
 
    bottom: 0; 
 
    left: 0; 
 
    background-image: linear-gradient(90deg , rgb(102, 51, 153) 20px, rgba(102, 51, 153, 0)); 
 
    width: 10%; 
 
}
<div class='test'> lorem ipsum </div>

+0

谢谢。问题是我正在使用输入,我不能点击“编辑”,因为有背景 –

+0

[SOLUTION](https://jsfiddle.net/dfyuq62v/) –