Here is an example of code block that utilizing the DIV and PRE HTML tags.
DIV tag is used to create a code block with scroll functions.
PRE tag is used to keep the structure/layout of source code with indents.
!!! Important !!!
If your code inside the block are HTML code, you must replace character "<" with string "<", and replace character ">" with string ">". Otherwise the HTML will be messed up!
Below is the result of sample:
class Scene extends ObjectModel
{
/** @var string Name */
public $name;
/** @var boolean Active Scene */
public $active = true;
/** @var array Products */
public $products;
protected $table = 'scene';
protected $identifier = 'id_scene';
protected $fieldsRequired = array('active');
protected $fieldsValidate = array('active' => 'isBool');
Below are the Opening tags of DIV, PRE and their style
<div style="width: 500px; height: 280px; border: 1px solid rgb(0, 0, 200); background: none repeat scroll 0% 0% rgb(0, 0, 0); color: rgb(255, 255, 255); padding: 4px; white-space: nowrap; overflow: auto;">
<pre style="margin-top: -20px;">
Below are the closing tags of PRE and DIV
</pre>
</div>
No comments:
Post a Comment