I need to include a web page in my jsp file. i.e: https://www.google.com
I tried both <s:include> and <include>, but it didn't work.
Please give me an example for that. Project is use Struts2 Framework.
You need to use an <iframe>.
The <iframe> element represents a nested browsing context.
For example:
<body>
<span>The following is an i-framed content:</span>
<iframe src="https://www.google.com" width="600" height="600">
</iframe>
</body>
Related
I'm trying to set up a website to display a twitch channel. For this, I embedded the channel, and the chat. I also put the logo. However, because the chat reaches down farther than the player, the logo can't go directly below the player. I know you could allow the logo to go below with tables, but those are a big headache, so I was wondering if there was another way to put the logo directly below the player. Website: https://katamonia--449243.repl.co/
<!DOCTYPE html>
<html>
<head>
<title>Katamonia</title>
</head>
<body style="background-color:#333">
<center>
<iframe align="top" src="https://player.twitch.tv/?channel=katamonia" frameborder="0" allowfullscreen="true" scrolling="no" height="582" width=74%>
<iframe frameborder="2"
scrolling="no"
src="https://www.twitch.tv/embed/katamonia/chat"
height="100"
width="100">
</iframe>
<iframe src="https://www.twitch.tv/embed/katamonia/chat?darkpopout" frameborder="0" scrolling="yes" height="758" width=24%></iframe>
</center>
</br>
<img align="top" src="https://static-cdn.jtvnw.net/emoticons/v1/778094/2.0" height="200" width="200">
</body>
</html>
So you forgot to close the first <iframe> tag with </iframe>. Then you can wrap different contents with <div></div> containers to create a clear structure and add proper alignment. I made a fiddle for you that shows you how you could do it:
https://jsfiddle.net/NicolasDurant/xp9wf8t6/
It also would be great, if you can extract your stylings out of your HTML file into a seperate CSS file, so you have all the stylings in one place.
There are alot of possibilities to align containers. I used flexbox. Here is a complete guide about that: https://css-tricks.com/snippets/css/a-guide-to-flexbox/
One of the most used libraries for arrangement and default components is bootstrap, you should give it a try:
https://getbootstrap.com/
Why does this code not display the YouTube site or other sites like Pandora:
<html>
<body>
<iframe src="https://www.youtube.com"></iframe>
</body>
</html>
The reason is, that youtube doesn´t allow that way of access. Just with an embed code, like:
<html>
<body><iframe width="640" height="360" src="http://www.youtube.com/embed/M7lc1UVf-VE" frameborder="0"/>
</body>
</html>
This will work, but whole youtube can´t be embedded.
Have a nice day.
The web page is not displayed when the following was inserted in the html. Neither was this working for any other link. Please tell me what is the problem in this?
<!DOCTYPE html>
<html>
<body>
<h2>HTML Iframes</h2>
<p>You can also use the CSS height and width properties to specify the size of the iframe:</p>
<iframe src="https://www.w3schools.com" style="height:500px;width:900px"></iframe>
</body>
</html>
Per the console:
Refused to display 'https://www.w3schools.com/' in a frame because it
set 'X-Frame-Options' to 'sameorigin'.
This means that W3 Schools will not allow you to display its pages in an external iframe.
No need to have the style attribute.
<iframe height="500px" width="800px" src="https://www.google.com" ></iframe>
That should fix it.
I have a html5 banner that I've been supplied with that has some animations and so on. How would I embed this inside an already existing html document? I don't want to grab the code from the html5 document, instead it would be nice if I could link to the html5 banner..
I don't know if this is possible though.
<html>
<body>
<!-- Embed html5 banner here -->
<div src="/assets/html5banner.html" /> <!-- Something like that, I don't know -->
</body>
</html>
Any push in the right direction would really be appreciated! Thanks
Use iframe to embed other html document into your page
<iframe src="#"></iframe>
iFrames are your friends.
<iframe src="/htmlanim.html"></iframe>
You can also be fancy-shmancy and use Ajax to append the content dynamically to an empty <div>-Container.
You should just use an iframe.
<html>
<body>
<img id="j_id58" width="800" border="0" height="400" src="c:/test/tmp/imageEE3A7BA3F55BC67061FD778F1B0136D6.png"/>
</body>
</html>
Why does this not render any image when I open it on firefox but does it on IE 6?
I bet this will work if you use a file:// URL instead of a filename.
<html>
<body>
<img id="j_id58" width="800" border="0" height="400"
src="file:///c/test/tmp/imageEE3A7BA3F55BC67061FD778F1B0136D6.png"/>
</body>
</html>
Try that.
Firefox doesn't support using the "C:/"-style path.
Instead use a relative URL or a real URL to that file hosted by a web server.
IE6 does support this.
Firefox requires the "file:///"-prefix when referencing local files.
In addition to the answers above, this is likely to fail if you load your HTML from an HTTP server.
This is likely because you need a src attribute with a file:\\ scheme.
Try file:///C://test/tmp/imageEE3A7BA3F55BC67061FD778F1B0136D6.png in the src and see if it works.