Is this do-able with <iframe> ? Center content

  • gbdata
  • Born
  • Born
  • User avatar
  • Posts: 4
  • Loc: Norway

Post 3+ Months Ago

I want to adjust (center) the source webpage in iframes.. Also knowing how to adjust up and down, if possible, would be nice. If no solution is availble, is there any other option? I was thinknig like using the object element be used instead of iframe tag for this .. ?

Here is the code the way it is now:

<div style="text-align: center;"> <br>
<iframe hspace="0" vspace="0" marginheight="0"
marginwidth="0" style="width: 650px; height: 550px;"
src="http://nmap-online.com/" frameborder="0"
scrolling="yes"></iframe></div>

I have illustrated the problem, it has been something i hav wonderet about in several cases if its doable.
Ive usen nmap-online , a online port scanner, as an example to illustrate what I want with pictures:

This is how it is now.. When I opens it in 1024x768 resolution
Image

This is how I want it to be, centered.
Image

Is it do-able? If a solution is possible, what about diffrent resolutions...

Also I tried changing marinwith\height but i couldnt see any diffrence. I also been tryin to use v\hspace without understanding what these are supposed to do, anyone care to explain ?
  • jameson5555
  • Bronze Robot
  • Bronze Member
  • User avatar
  • Posts: 575
  • Loc: Phoenix, AZ

Post 3+ Months Ago

I don't know of a way to do that... although you could get the content of the iframe to center vertically by using anchor IDs. For example, in your screen shot above, you could point the iframe to http://nmaponline.com/index.htm#newscan. That's assuming, of course, that the element you're trying to point to already has an ID or that you can create one for it.

Other than that, maybe there's a JavaScript solution someone else would know about?
  • gbdata
  • Born
  • Born
  • User avatar
  • Posts: 4
  • Loc: Norway

Post 3+ Months Ago

thanks for your reply, however I fail to see any anchor on this page. . but its a good idea nevertheless which i might use for other tasks.

Now remember, im a newbie and are trying to learn, so my questions may be stupid and I lack some terminology in this field so ill try to illustrate my points as good as I can, using photos and text examples..

When I searched the source code i found this line;

<fieldset><legend><span>New Scan</span></legend>

From my very basic understanding of HTML, fieldset is a somewhat kind of anchor only its not. It tells which section is which and what should be in which section and you can change the style of these sections diffrently using CSS, correct? Correct me if I get this wrong, as I said im learning ;)

Now so I have some other question.. can you make a link that will only show one fieldset? link.com/#ยค%showfieldset name or whatver lol. using the same idea as the above poster only using fieldset instead of anchor... in other words; a iframe that shows only a spesific fieldset.. doable?
can this function be used at all to complete my task?

Probably not, but on the good side, it made me look up this function and i learn something even when im off lol

Maybe a javascript could block out showing the banners on the sides in a iframe..
  • gbdata
  • Born
  • Born
  • User avatar
  • Posts: 4
  • Loc: Norway

Post 3+ Months Ago

Ok someone explain this for me.. Im reading up on the iframe attributes and I see this page showing VSPACE and HSPACE..

http://www.htmlcodetutorial.com/frames/ ... SPACE.html

There are three examples there, but what on earth is diffrent.. they look exactly the same to me..?

What am I missing here?
  • jameson5555
  • Bronze Robot
  • Bronze Member
  • User avatar
  • Posts: 575
  • Loc: Phoenix, AZ

Post 3+ Months Ago

Check out that link in IE and you can see what's different.. looks like it doesn't work in Firefox, maybe because iframes are deprecated or something.

hspace and vspace look like they basically just act as margins- not internal iframe positioning like I think you were wanting.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 45 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.