如何从输入中删除类似边框的边框?

时间:2021-08-03 22:15:58

I wanted to achieve the same effect with input element as I can achieve with contenteditable attribute. What I have done can be seen in jsFiddle.

我想用输入元素实现相同的效果,因为我可以通过contenteditable属性实现。在jsFiddle中可以看到我所做的。

HTML :

<div class="greenStripe">
    <input placeholder="Title" class='t'/>  
</div>

CSS :

.greenStripe{
    background-color:#13b4ff;
    width: 100%;
    height: 100px; 
}
.greenStripe .t{
    margin: 20px 0 0 10%;
    font-size: 42px;
    background-color:#13b4ff;
}

Basically <input/> looks almost the same as contenteditable, but I have this terrible borders. Can I somehow get rid of them with CSS?

基本上看起来几乎与contenteditable相同,但我有这个可怕的边界。我可以用CSS以某种方式摆脱它们吗?

1 个解决方案

#1


7  

input { border-style: none; outline: 0; }

JSFiddle

#1


7  

input { border-style: none; outline: 0; }

JSFiddle