Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    New Coder
    Join Date
    Feb 2003
    Location
    SD, CaLi
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    centering iframes?

    i know... it sounds like a simple question...

    but i dunno how to do it...

    i have a background picture... with boxes and stuff where the iframes are supposed to go, when u maximize or resize the window... the background picture would stay centered no matter how big the window is... but the iframes stay in the same spot.. and they dont follow the bg picture

    can someone help me plz?
    ([-=JpDm=-])

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    do you have a link to the site?

  • #3
    New Coder
    Join Date
    Feb 2003
    Location
    SD, CaLi
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    its on my computer

    but ill post what i have so far to show u
    ([-=JpDm=-])

  • #4
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Im not really sure that this is a javascript question, a moderator will move it to the right forum for you. Im pretty sure that you could just center the iframe, but id have to see it myself.

  • #5
    New Coder
    Join Date
    Feb 2003
    Location
    SD, CaLi
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    http://www.geocities.com/sdalphabeta/index2.htm

    kk... what I see... is the iframe fitting perfectly into the window ( i know the iframes are broken links now, just getting started xD)

    but when i maximize the window... the bg image moves to the center... but the iframes stay in the same spot

    how would u center that?
    ([-=JpDm=-])

  • #6
    New to the CF scene
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    You're in luck!

    You're in luck man, I'm one of the newest programmers here as well as this is my first day here! I've only learnt the basic html, and recently after (who knows how long I've returned to learning web design after 1 or 2 years since my first pitiful attempt at a website). Anyway I began asking a friend who has a great webseite, along with another(and they're both girls, so it definitely proves that everyone is equal, and I do find alot of girls are into web design now adays, quite interesting if you ask me.) for help.

    Sorry for telling you my life story, anyway, the first thing one of them went into was iframes, haha and using my common sense I asked how you'd reposition the iframe on the page. Anyway, you're in luck here is the source code for it and btw iframes isn't java script related, unless you want to use it to enhance/modify the iframe:

    <HTML>
    <HEAD></HEAD>

    <BODY>
    <p>&nbsp;</p>
    <div style="position:absolute;top:100;left:150">
    <iframe width="200" height="300" src="page.html">
    </iframe></div></p></BODY></HTML>


    Ok replace the src with the page you want to display, and then youfcan modify the width/height of the iframe. The <div styleE= " position: absolute, basically means that you are saying to put it anywhere on the screen. Play around with the values of the top and left until you get it positioned into the background boxes allotted for it. And then that code also gives you the nifty feature of resizing just incase you estimated the box's measurements incorrectly.

    Good luck, and, I also got taught how to change the colour of the iframe scroll bar if your interested.....
    Cordially,
    Crystal Cloud/[WT}

    "Happiness makes up in height, for what it lacks in length"- Robert Frost

    Confucius says: Man who drops watch in toilet has s***ty time


    Today's Joke: As a senior citizen was driving down the freeway, his car phone rang. Answering, he heard his wife's voice urgently warning him, "Herman, I just heard on the news that there's a car going the wrong way on 280. Please be careful!" "Hell," said Herman, "It's not just one car. It's hundreds of them!"

  • #7
    New Coder
    Join Date
    Feb 2003
    Location
    SD, CaLi
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx... but i already know how to make iframes... :x

    i just wanted to know if there was a way to make them move along with your site...and not just stay in the same spot...


    or if that doesnt work... how would u make div layers for it


    ps. sorry i posted in wrong forum
    ([-=JpDm=-])

  • #8
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Ok im not a css guru or anything, but i think i can help you sort out your site a bit and what i cant do, others can. First of all, I'm sorry to have to break it to you that tables are not the way to design the layout of your site. Tables are for arranging data, such as in a science experiment you may put your data in a table. The way to go with webdesign is css. As I look at your source I can see that you already know css so now all you need to do is use a lil more of it. The way to go, is to arrange a <div> and put your content inside.

    There are also some things in your code that need to be coded in css rather than inline and some things that just plain aren't supported by standards anymore. As a starter, all of the things inside the body tag need to be removed and placed in a css declaration like so:
    Code:
    body {
      background: #1B1B1B;
      margin-top: 0;
      margin-left: 0; 
    }
    
    a:link {color: #FFFFFF;}
    a:visited {color: #FFFFFF;}
    a:hover {color: whatever color you want;}
    a:active {color: ##999999;}
    I also suggest replacing the font tag with a <p> and some css. I've gotta go now, but I'll be checking back and adding some more stuff you could do to make your website reach its full capabilities.

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,968
    Thanks
    0
    Thanked 236 Times in 233 Posts
    You can put the iframe in between <center></center> tags but that tag is already deprecated. You should use CSS.

    <div style="text-align:center">
    <iframe src="page.htm"></iframe>
    </div>

  • #10
    New to the CF scene
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    All I know is if you want to align the background the white templates with the iframe:

    <HTML>
    <HEAD></HEAD>

    <BODY>
    <p> </p>
    <div style="position:absolute;top:100;left:150">
    <iframe width="200" height="300" src="page.html">
    </iframe></div></p></BODY></HTML>

    And then just change the values to align. About making the iframes actually move with the page as you scroll down, well I have no clue< i don't know any css, java, and hardly any html, but I must say I've never seen one site with a feature like that. Whether it's possible or not, I'm not sure, btu then again I'm sure everything is in web design.
    Cordially,
    Crystal Cloud/[WT}

    "Happiness makes up in height, for what it lacks in length"- Robert Frost

    Confucius says: Man who drops watch in toilet has s***ty time


    Today's Joke: As a senior citizen was driving down the freeway, his car phone rang. Answering, he heard his wife's voice urgently warning him, "Herman, I just heard on the news that there's a car going the wrong way on 280. Please be careful!" "Hell," said Herman, "It's not just one car. It's hundreds of them!"

  • #11
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts
    I know no one wants to hear this (and I don't care), but I just use regular frames to position things the way I want.

    My entire site is a frames/iframes mix...

    http://arctic.ithium.net/

    *Don't listen to these people who say you can't use tables, center tags, this, that, blah, blah... It's your site - do as you wish with it!

    -A.F.
    Last edited by ArcticFox; 01-14-2004 at 05:21 AM.
    <div> - putting your mind in a box since 1997

  • #12
    New to the CF scene
    Join Date
    Jan 2004
    Location
    Australia
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I agree arctic, not to go off topic but anyone can create a masterpiece website using anything. Ok maybe if you used just html the normal <b>, <H1> etc it wouldn't look as nice, but I think there's nothing wrong with tables. Alot of people I know use tables for teir website the different sections: the blog, latest news etc, and have an iframe in the middle to load any pages you click links on.

    However the code I did post will let you position the iframe basically anywhere....it's offtopic but I also have css code to change the colour of the scroll bar etc, as well as bits to put in to neaten up the page using css(my html page looked very different with the css code!).
    Cordially,
    Crystal Cloud/[WT}

    "Happiness makes up in height, for what it lacks in length"- Robert Frost

    Confucius says: Man who drops watch in toilet has s***ty time


    Today's Joke: As a senior citizen was driving down the freeway, his car phone rang. Answering, he heard his wife's voice urgently warning him, "Herman, I just heard on the news that there's a car going the wrong way on 280. Please be careful!" "Hell," said Herman, "It's not just one car. It's hundreds of them!"

  • #13
    Regular Coder
    Join Date
    Oct 2003
    Location
    SC
    Posts
    936
    Thanks
    0
    Thanked 0 Times in 0 Posts
    artc? your site looks good but the bad thing is i cant scroll down.

    and the whole page does not fit in my resolution

  • #14
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    For that very reason, css is the answer. With css you can make your site liquid, or viewable across different resolutions. Im not gonna say that you shouldn't use tables, im just saying that if you want to save yourself alot of frustration get rid of them.

  • #15
    Regular Coder ArcticFox's Avatar
    Join Date
    Jan 2004
    Location
    Vostok Station, AQ
    Posts
    602
    Thanks
    35
    Thanked 3 Times in 3 Posts

    Internet Explorer

    Quote Originally Posted by JAVAEOC
    artc? your site looks good but the bad thing is i cant scroll down.

    and the whole page does not fit in my resolution
    What is your resolution and browser?
    This site is designed to fit inside 800x600+.
    Last edited by ArcticFox; 05-28-2005 at 01:34 AM.
    <div> - putting your mind in a box since 1997


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •