Question: **Short story:**

```
// get the editor instance
var editor = CKEDITOR.instances.editor1;

// this is what I want, but it does not exist
editor.execCommand('delete');

// I've played with this, found somewhere, but without success.
editor.fire('key', { keyCode : 46 } )

```

**Long story:**

there is a problem when using the CKEditor within the Webbrowser control from .NET WindowsForms. Several keys, including the DELete key are not propagated to the control at all.

I managed to intercept the key using a global keyboard hook and sent window messages direct to the embedded IE window handle, but without success.

Now my goal is to simulate the delete key from within the javascript, because I can call a js function from my .NET app.
Somehow this must work, because it works within the virtual keyboard plugin.
(see [sample](http://debugger.ru/demo/projects/virtualkeyboard/richedit/ckeditor/plugins/Jsvk/examples/sample.html))

Sadly I wasn't able to get how this works from the plugin code.
I would be glad if anybody can post a working sample.

Thanks!

Answer: 
You should use media query for that:

```
div {
width:70%;
}

@media only screen and (max-width: 500px) {
    div {
        width:90%;
    }
}

```

[Get a head start on media queries](http://www.w3schools.com/css/css_rwd_mediaqueries.asp)

Or use a framework like [bootstrap](http://getbootstrap.com/getting-started/)

Using bootstrap, you can achieve that using:

```
<div class="col-md-10 col-md-offset-1 col-xs-12">blah blah</div>

```
You can combine your size media query with a resolution media query:

```
@media (max-width: 600px) and (-webkit-min-device-pixel-ratio: 2), /* Webkit-based browser */
       (max-width: 600px) and (min-resolution: 2dppx), /* The standard way */            
       (max-width: 600px) and (min-resolution: 192dpi) /* dppx fallback */           

```