Connecting Tech Pros Worldwide Help | Site Map

IFrame align="center" in Netscape and Firefox

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 07:52 PM
50295@web.de
Guest
 
Posts: n/a
Default IFrame align="center" in Netscape and Firefox

Hi!

I'm trying to set the align property/attribute of an IFrame to center
but its not working (see below). Can anyone please tell me what's going
on, and if there's a work around for this?

Thanks,

- Olumide

/////////////////// code //////////////////

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>

<title>test</title>
</head>

<body>

<iframe src="sampleContent.htm" width="620" height="500"
align="center"></iframe>

</body>
</html>


  #2  
Old July 23rd, 2005, 07:53 PM
RobB
Guest
 
Posts: n/a
Default Re: IFrame align="center" in Netscape and Firefox

5...@web.de wrote:[color=blue]
> Hi!
>
> I'm trying to set the align property/attribute of an IFrame to center
> but its not working (see below). Can anyone please tell me what's[/color]
going[color=blue]
> on, and if there's a work around for this?
>
> Thanks,
>
> - Olumide
>
> /////////////////// code //////////////////
>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html;[/color]
charset=iso-8859-1"[color=blue]
> />
>
> <title>test</title>
> </head>
>
> <body>
>
> <iframe src="sampleContent.htm" width="620" height="500"
> align="center"></iframe>
>
> </body>
> </html>[/color]

Use CSS, along with a proper doctype:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>test</title>
<style type="text/css">

body {
text-align: center;
}
#foo {
display: block;
width: 620px;
height: 500px;
margin: 0 auto;
}

</style>
</head>
<body>
<iframe id="foo" src="sampleContent.htm"></iframe>
</body>
</html>

The body rule is for ie5win:

http://www.bluerobot.com/web/css/center1.html

  #3  
Old July 23rd, 2005, 07:57 PM
Nate Pilkington
Guest
 
Posts: n/a
Default Re: IFrame align="center" in Netscape and Firefox

50295@web.de wrote:[color=blue]
> Hi!
>
> I'm trying to set the align property/attribute of an IFrame to center
> but its not working (see below). Can anyone please tell me what's going
> on, and if there's a work around for this?[/color]

<SNIP>

Perhaps this is not Javascript?

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.