DEV Community

Discussion on: TOP 4 Easiest Way To Align Div Center

Collapse
 
andrewbaisden profile image
Andrew Baisden

Just a heads up that you can add highlighting to the code blocks if you'd like. Just change:

code block with no colors example

... to specify the language:

code block with colors example

More details in our editor guide!

Collapse
 
prakash1245 profile image
Chandra

I write code inside


 but not working . I think 

Enter fullscreen mode Exit fullscreen mode


usefull for javascript code

Collapse
 
andrewbaisden profile image
Andrew Baisden

No the syntax highlighting works for all programming/markup languages Markdown Extended Syntax.

Using your first code snippet as an example:

Use backticks I only used quotes below to stop it from turning into a code block.

'''html

'''

<html>
  <head>
    <style>
      #parent-div{
        margin:20px;
        width:400px;
        height:150px;
        border:1px solid black;
      }
      #child-div{
        width:80px;
        height:80px;
        border:1px solid blue;
        margin:0 auto;
      }
    </style>
  </head>
  <body>
    <div id='parent-div'>
      <div id='child-div'></div>
    </div>
  </body>
</html>
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
prakash1245 profile image
Chandra

Thanks Andrew Baisden