Friday, March 13, 2015

Bootstrap Codes

 A user should use <code> tag for displaying the code inline and likely so the user needs to display the code as standalone block elements and for that the user needs to use <pre> tag.  This way we can work with codes and scripts in bootstrap. A detailed example is given below :


Example:

 <!DOCTYPE html>  
 <html>  
 <head lang="en">  
   <meta charset="UTF-8"/>  
   <title>nirajanghimirey's workshop</title>  
   <meta name="viewport" content="width=device-width, initial-scale=1"/>  
   <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/>  
 </head>  
 <body>  
 <p>  
 <pre>  
   &lt;article&gt;  
    &lt;h1&gt;This is an example of Joe's code&lt;/h1&gt;  
     &lt;h2&gt;This is how a code is written&lt;/h2&gt;  
   &lt;/article&gt;  
 </pre>  
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>  
 <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>  
 </body>  
 </html> 

No comments:

Post a Comment