2014-09-23 132 views
0

我有一個textarea,我仍然覺得難以處理。我已經完成了所有的裝飾,但仍然有一些問題。 輝光和邊框不會消失,它很煩人。是form-control班嗎?我把它移開了,我幾乎暈倒了。刪除文本區的輝光,邊框,垂直/水平卷軸

  1. 使用div獲取用戶數據而不是textarea是否存在風險/兼容性問題?
  2. 我該如何讓textarea看起來安靜,柔軟和靈活?沒有邊界,沒有發光,沒有垂直/水平卷軸,沒有任何東西。只是一個簡單的空白,我可以調整。

HMTL

<div class = 'comment_wrapper'> 
    <textarea class="commment_content form-control" rows = '1' placeholder=""></textarea> 
    <button class="post_cs btn btn-xs" name = "update" type="submit">Comment</button> 
    <button class="post_cs btn btn-xs" name = "sms" type="submit">Cancel</button> 
</div> 

<div class = 'comment_wrapper'> 
    <div class='commment_content' contentEditable = 'true'> 

    </div> 
    <button class="post_cs btn btn-xs" name = "update" type="submit">Comment</button> 
    <button class="post_cs btn btn-xs" name = "sms" type="submit">Cancel</button> 
</div> 

CSS

textarea{ #have tried class commment_content 
    border: none; 
    overflow: auto; 
    outline: 0; #have tried none 
    -webkit-box-shadow: none; 
    -moz-box-shadow: none; 
    box-shadow: none; 
} 

所有我需要div家設置其contentEditableTrue

enter image description here

+1

你能舉一個例子對我來說似乎很好http://jsfiddle.net/b8jg0d59/ – DaniP 2014-09-23 15:38:09

+0

該代碼告訴我你正在使用bootstrap,是嗎?如果是這樣,哪個版本? – 2014-09-23 15:38:12

+0

@ caeth:是的,我使用的是3.0版本。 – Yax 2014-09-23 15:39:39

回答

0

你需要從.form-control

覆蓋引導造型

你的CSS改成這樣:

textarea{ 
    outline: none; 
    border: none !important; 
    -webkit-box-shadow: none !important; 
    -moz-box-shadow: none !important; 
    box-shadow: none !important; 
} 

而且你會刪除大綱,邊境,距離你的textarea發光。