1.

Explain <iframe> in HTML.

Answer»

<iframe> tag is also called HTML inline frame element. It is generally used to display the content of another WEBSITE inside our web-page. One of the most common uses is to display maps, inside our webpage. We are doing the same in our example.

The <iframe> tag have MANY attributes like - src, width, height.

  • The src attribute is the address of the website you want to display.
  • The width and height specify the dimensions of the iframe.
<!DOCTYPE html> <html> <head>    <title>iframe tutorials</title>    <STYLE>        .grid__iframe {            display: grid;            place-content: center;        }    </style> </head> <body> <DIV class="grid__iframe">        <h1>Bangalore Map</h1>        <iframe width="980" height="600"        src="https://www.openstreetmap.org/export/embed.html?bbox=77.24761962890626%2C12.746176829427839%2C77.82440185546876%2C13.231924637991806&amp;layer=mapnik"        style="border: 1px solid black">    </iframe> </div> </body> </html>



Discussion

No Comment Found