Skip to main content

how to create a blog using html CSS and JavaScript

To adapt the provided HTML for Blogspot, we’ll format it so you can paste it directly into the **HTML editor** of a Blogspot post. Here's the final code: --- ### Blogspot-Compatible Code ```html

How to Display Code Safely in Blogspot

To display HTML, CSS, and JavaScript code in your Blogspot blog without executing it, follow these steps:

1. Escape the Code

Replace special characters in your code with HTML entities:

<script>
  alert('Hello, world!');
</script>
  

2. Use the Blogger HTML Editor

Switch to the HTML View in Blogger's post editor and paste your escaped code there.

3. Style the Code Block

Wrap the code in a <pre> or <code> tag and style it with CSS:

<pre style="background-color: #f4f4f4; padding: 10px; border: 1px solid #ddd; overflow-x: auto;">
<h1>Hello World</h1>
</pre>
  

4. Use a Syntax Highlighter (Optional)

For better readability, include a syntax highlighter like Prism.js. Add the library’s CSS and JavaScript to your theme and use classes to highlight syntax.

5. Preview Your Post

Ensure everything looks good in the preview before publishing.

© 2024 Dan Maffia Code Display Guide - All Rights Reserved
``` --- ### Steps to Use in Blogspot 1. Open **Blogger** and go to **Posts** > **New Post**. 2. Switch to the **HTML View** (located in the toolbar or settings menu of the editor). 3. Paste the above code directly into the editor. 4. Preview your post to ensure it looks as intended. 5. Publish the post. ### Final Look: - **Dark mode design** with a bordered container. - Code blocks are styled for readability. - Syntax highlighting instructions are included for optional enhancement. Would you like additional customization or integration?

Comments

Popular posts from this blog

How to Move, Copy & Delete files in Termux

How to Move, Copy & Delete files in Termux How to Move, Copy & Delete files in Termux How to Move, Copy & Delete files in Termux.         Hello friends, in this post I am going to tell you how you can move and copy and delete any file and folder in termux. We saw the basic commands of termux in the previous post. Now we will see the commands that copy, move and delete files. Important things for this 1.     Termux Apk: -    Download 2. Termux Apk:- Download How to move files and folders in Termux?           So let us first see how to move files and folders. we use the move and cut option to move a file to another folder in the file manager. So in that way we use 'mv' command to move a file in termux. With this command, you can move any files, apk, song, movie, folder.          So how to use this command. For this, you have to see the steps given b...

Setting up a free SMTP server for sending emails

Setting up a free SMTP server for sending emails typically involves using an email service that offers free SMTP access. Here's a general guide on how to set up SMTP for free: 1. **Choose a Free Email Service**: There are several email providers that offer free SMTP servers, including Gmail, Yahoo Mail, and Outlook.com. Choose the one that suits your needs. 2. **Create an Email Account**: If you don't already have an email account with the chosen provider, sign up and create one. Make sure to remember your email address and password. 3. **Enable SMTP Access**: Some email providers may require you to enable SMTP access for your account. This is often found in your account settings or security settings. Enable SMTP access if required. 4. **Obtain SMTP Server Details**: Your email provider will have specific SMTP server details you need to use. These typically include:  - SMTP Server Address (e.g., smtp.gmail.com for Gmail)    - SMTP Port (e.g., 587 for STARTTLS or 465 for SSL/T...

Bash Cheetsheet

Top 25 created and custom command 4th, February, 2023  The command line is something every developer should learn and implement into their daily routine. It has become a Swiss Army knife of features behind deceptively simple commands, which allow you to gain greater control of your system, become more productive, and much more. For example, you can write scripts to automate daily, time-consuming tasks, and even quickly commit and push code to a Git repository with just a few simple commands. In this post, we’ll look at the Bash Shell (Bourne Again SHell), which is a command-line interface (CLI) and is currently the most widely used shell. This is a light introduction to the most popular commands, when you’re most likely to use them, and how to extend them with options. Later on in this article, you’ll learn how to create your own custom commands (aliases), allowing you to create shortcuts for a single command or a group of commands. When it comes down to it, if you don’t know the comma...