This commit is contained in:
Ilya Kantor 2017-03-18 14:46:13 +03:00
parent 1f61c2ab1d
commit af0ee2a49e
66 changed files with 12263 additions and 2059 deletions

View file

@ -0,0 +1,27 @@
<!DOCTYPE HTML>
<html>
<head>
<link type="text/css" rel="stylesheet" href="my.css">
<meta charset="utf-8">
</head>
<body>
<ul>
<li>Click the div to edit.</li>
<li>Enter or blur saves the result.</li>
</ul>
HTML is allowed.
<div id="view" class="view">Text</div>
<script>
// ...your code...
// Note: <textarea> should have class="edit"
// my.css has styles to make it the same size as div
</script>
</body>
</html>

View file

@ -0,0 +1,25 @@
.view,
.edit {
height: 150px;
width: 400px;
font-family: arial;
font-size: 14px;
display: block;
}
.view {
/* padding + border = 3px */
padding: 2px;
border: 1px solid black;
}
.edit {
/* replace padding with border (still 3px not to shift the contents) */
border: 3px solid blue;
padding: 0px;
}
.edit:focus {
outline: none;
/* remove focus border in Safari */
}