How to embed a Google map in HTML? – iframe method

In this post, you will learn to embed a Google map in HTML. You can embed a Google map in HTML either by using the API key or by using iframe-based HTML code. Here, in this post, I will tell you the steps to use iframe-based HTML code to add a google map to an HTML webpage.

Steps to insert a Google map in HTML webpage –

  1. You first need to open Google Maps. And then search for the location that you want to show on your webpage.

2. After you have searched the location, click on the “share” button.

3. When you click on the share button, a small window opens. You will find the “embed a map” option there, click on that.

4. Now, you will see an HTML code. That’s the code you copy and paste into your HTML file. Just click on “copy HTML” and paste the code into your HTML file.

Before copying the code, you can also select the size of the map by clicking on the dropdown menu.

Now, let’s see an HTML example.


<!DOCTYPE html>
        <title>Embedded Google map example</title>
                background-color: aliceblue;
                text-align: center;
                margin-top: 5%;
            <h1>EMBEDDED GOOGLE MAP EXAMPLE</h1>


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: