Align Iframe to the right ?

cynic

Regular Member
Joined
Oct 16, 2010
Messages
405
Reaction score
45
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>


<body>
<iframe id='bframe'  name='bframe' src='http://www.fatcatrewards.com/uk/bonuscash/?l=50' align="left" style='border: 0pt none ; left: -616px; top: -211px; position: absolute; width: 1024px; height: 649px;' scrolling='no'></iframe>


</body>
</html>

Hey there

I'm basically trying to align this iframe to the right so I can input another similar iframe to the left . I'd appreciate any help you html warriors can provide ?
 
Last edited:
Sometimes you need to add:
Code:
display: block;
float: right;
If it's displayed inline, the float won't work.
You also might need to specify a width
 
If you are wanting to put another iframe to the left of it, like you said, then you will need to use DIVs.. also, in the code you posted, you have align="left"

Try something like this.. you may need to tweak it, its off the top of my head as I dont feel like creating a new html file and double checking it:

Code:
<style type="text/css">
#wrapper
 {
    width: 100%;
    height: 310px;
    margin: 0;
    padding: 0;
}
#leftframe
 {
    display: block;
    float: left;
    width: 400px;
    height: 300px;
 }
#rightframe
    display: block;
    float: right;
    width: 350px;
    height: 250px;
 }
</style>

<div id="wrapper"><!-- this holds everything together and is needed! -->
  <div id="leftframe"><iframe src=""></iframe></div><!-- left iframe -->
  <div id="rightframe"><iframe src=""></iframe></div><!-- right iframe -->
</div>

Just an example. you will need to adjust sizes, paddings/margins, styling to your needs. But this code shows the concept of how to get two things, side by side.
 
you need a table contains two columns
such as:
HTML:
<table align=center>
<tr><td>your first iFrame code here</td><td>your second iFrame code here</td></tr>
</table>
 
Back
Top