DRastislav
DRastislav

Reputation: 1882

html - how to load another page in the middle of first page

i have embarrassing question concerning to elementary knowledge of HTML

I would like Open/load second page in my first page

Menu button which loads second page -

<li class="current"><a href="first.html" target = "myContent">About us</a></li>

part of my firstpage is called "myContent" but (Opening of second page) doesn´t work properly (Page is opened in another Window)

<div id="myContent" name="myContent" style="background-color:#EEEEEE;height:200px;width:800;float:left;"> </div> 

What amI doing wrong? Thanks

Upvotes: 0

Views: 378

Answers (2)

ATOzTOA
ATOzTOA

Reputation: 35950

Use this instead of the div

<iframe id='myContent'></iframe>

Upvotes: 1

Viktor S.
Viktor S.

Reputation: 12815

You should replace your div#myContent with an iframe:

<iframe id="myContent" name="myContent" style="background-color:#EEEEEE;height:200px;width:800;float:left;"> </iframe> 

You may need to add some additional styling here.

Or you can use AJAX to load content with JS.

Upvotes: 1

Related Questions