CKEditor "Source" button does not brings back the full html I have written a full html code

&lt;div style="background-color:red"&gt;&amp;nbsp;&lt;/div&gt;


But when I edit the content and click on the "Source" button provided in the CKEditor toolbar. nothing is showing up

In Advanced content filter I have given in Extra allowed content

p(*)[*]{*};div(*)[*]{*};li(*)[*]{*};ul(*)[*]{*} 


In Custom JavaScript configuration I have given

config.allowedContent = true;
I know D8's CKEditor doesn't allow you to use the style attribute to prevent click jacking attacks, example.

Can't remember if D7 CKeditor did or not, but either way, it's bad security practice to allow people to use style attribute.

The better approach is to use a class. 

&lt;div class="bg-red"&gt;...something goes here...&lt;/div&gt;


Your Drupal theme's style.css 

.bg-red { 
  background-color:red;
}