logo

modern front end tech

buttons and iframes in html

In this chapter you are going to learn:-

what is button element

The <button> element in HTML is used to create clickable buttons on a web page. These buttons can be used to submit forms, trigger JavaScript functions, or perform other actions when clicked by the user.

<button>Click Me!</button>

styling buttons

Buttons can be styled using CSS to change their appearance, such as background color, font size, border style, and more. You can also add hover effects to enhance user interaction.

                
                    button{
                       background-color: blue;
                       color: white;
                       padding: 10px 20px;
                       border: none;
                       border-radius: 5px;
                       cursor: pointer;
                       }
                
            

iframes

The <iframe> element in HTML is used to embed another HTML document within the current document. It creates a rectangular area on the page where the external content is displayed.

<iframe src="https://www.example.com" width="600" height="400"></iframe>

in iframes uwe used to type in the url of the iframe and you know that we use width and height attributes to set the width and height of iframes (instead you can also use css)

examples of iframes

Here is an example of an iframe embedding a YouTube video:

<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>

load links in iframes

You can load different web pages or links within an iframe by changing the src attribute. This allows you to display various content without navigating away from the main page.

<iframe name="iframe"src="https://www.wikipedia.org" width="800" height="600"></iframe>
<a href="#" target="iframe">n</a>
our youtube channel