How to remove the border from an editable element with CSS?


To remove the border from an editable element, the code is as follows −

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
   body{
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
   }
   p{
      font-size: 40px;
   }
   [contenteditable] {
      outline: 0px solid transparent;
   }
</style>
</head>
<body>
<h1>Remove Contenteditable Border Example</h1>
<p contenteditable="true">This is a contenteditable paragraph which you can edit</p>
</body>
</html>

Output

The above code will produce the following output −

On clicking the paragraph, you can edit it as in the below screenshot −

Updated on: 08-May-2020

154 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements