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

CSSWeb DevelopmentFront End Technology

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 −

raja
Published on 08-May-2020 18:07:30
Advertisements