1

Hi I'm using JupyerLab and would like to render a block of text HTML formatted:

<div style="background: #DFF0D8; border-radius: 3px; padding: 10px;">
   <p><b>Exercise T1 (From the Allen tutorials):</b>

   Use <code>np.array</code> to create a 3-dimensional array with the shape (2, 4, 3).  
   Also, explore how the colon operation works here -- write a sentence on what you find.

</div>

But I get this error:

  File "<ipython-input-52-dda4835ea64f>", line 1
  <div style="background: #DFF0D8; border-radius: 3px; padding: 10px;">
  ^
  SyntaxError: invalid syntax

What am I doing wrong? Pretty sure my HTML syntax is fine, is this even possible to do in a JupyterLab IPYNB notebook?

  • Does this answer your question? [How to embed HTML into IPython output?](https://stackoverflow.com/questions/25698448/how-to-embed-html-into-ipython-output) – Tanner Dolby Jan 07 '21 at 20:25

1 Answers1

-1

You can change cell types to be of

  1. code
  2. markdown
  3. raw

Select markdown and you can render HTML.