![]() ![]() Now, when the AMP iframe component has been included, let's get to know it a bit better. It all pretty much narrows down to a single script tag you would want to include: Here are a few things about the amp-iframe to get you started:įirst of all amp-iframe is the part of AMP's extended Components – you can't just use it in the markup you are about to define – you need to call the script handling it in the page's first. ![]() Of course, there are still plenty of restrictions to pay attention for in order to get the Validation's approval but at least including a bit more complicated content is not a chimera as it might seem like at first. The answer is YES - AMP pages can carry custom scripts and more complicated content as long as it's being a part of a different web page published somewhere aside and just referenced in the AMP page via an amp-iframe element. At the certain point that can be understood – removing tons of stuff will definitely make a page using AMP Layout Template load faster but what comes to be done when some custom script elements just need to take place? Are such pages suitable for transforming to AMP? So, no matter, what is our personal opinion about, this whole thing making sense or not, in a world, overruled by a particular search engine, this AMP thing about is definitely worth the shot.Īt first glance it all can be summarized by a single word – "RESTRICTIONS" – you can't have your own style sheets, run your own scripts and some of the tags must carry different AMP-specific names instead of the ones we are used to in a regular HTML. AMP claim to be providing faster and better user experience and in order to support them, Google, in turn, claims that sites having AMP mirrors will get their content higher ratings and places in the search results list. The HTML Event attributes are supported by the HTML tag.AMP IFrame - amp-iframe examples and tricks Embedding iframes in AMPĪs we talked before, Accelerated Mobile pages of AMP are one of the latest trends powered and pushed up by Google. The HTML GLobal attributes are supported by the HTML tag. Used to never display the scrollbar for the iframe. Used to always display the scroll bar for the iframe. Used to display if the content of iframe is larger than its dimensions. ![]() Used to specify whether to provide a scroll bar for the iframe or not. Used to show the HTML content in the inline iframe. Used to treat the embedded resource as downloaded from the same source. Used to enable popups which otherwise will not open. Used to allow submission of the form which otherwise is blocked. Used to apply extra restrictions for the content of a frame. ![]() Used to to define the web address of the inline frame page. Used to specify the width of embedded frame (default width is 300 px). Used to specify whether an iframe should have a border or not. Used to specify the height of the iframe (default height = 150 px). Iframe attributes:īelow are the various attributes used with an HTML tag. In the above example, we embedded a YouTube video on a webpage. If required, modify the height, width, and other properties of the video.Copy and paste the generated HTML code in the desired HTML file.Click on the SHARE video option and than on the Embed option.To add a YouTube video on a webpage follow the below steps: In the above example, the respective link opens in the iframe on clicking, since the specified target of the respective link matches the name of the iframe. ![]()
0 Comments
Leave a Reply. |