Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/11/2011, 23:27
Avatar de jor_0203
jor_0203
 
Fecha de Ingreso: octubre-2011
Ubicación: mexico
Mensajes: 760
Antigüedad: 12 años, 6 meses
Puntos: 8
¿se puede hacer un editor de texto con puro css?

¿se puede hacer un editor de texto con puro css?
este código de abajo funciona y lo encontré en este portal
pero he tratado de codificarlo para que se adapte a css
y no he podido
alguien tiene un ejemplo por ahí donde pueda hacer un editor de texto con css


Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin título</title>
  6. <script>
  7. function formatText(cmd){
  8.     document.execCommand(cmd, null, null);
  9. }
  10. function insertarImagen(){
  11.     var u;
  12.     if(!(u=prompt('ingresar url','http://')))return;
  13.      document.getElementById('pp').focus();
  14.      document.execCommand("InsertImage",false,u);
  15. }
  16. </script>
  17. </head>
  18.  
  19. <body>
  20. <form action="" method="get">
  21.   <input name="input" type="button" onclick="formatText('bold')" value="NEGRITA" />
  22.   <input name="input" type="button" onclick="formatText('italic')" value="CURSIVA" />
  23.   <input name="input" type="button" onclick="formatText('underline')" value="SUBRAYADO" />
  24.   <input name="input" type="button" onclick="insertarImagen()" value="INSERTAR IMAGEN" />
  25. </form>
  26. <div id="pp" contenteditable="true">Este es un texto editable</div>
  27. </body>
  28. </html>