PDA

View Full Version : heres a nice easy one


shogun rua
12-28-2010, 06:29 PM
Hi,

How do i centre a div tag so it centred in the brower when opened,

Im only using 1 div tag with a swf in it.

Cheers

Paul

gigiloumill
12-28-2010, 06:50 PM
Give the div a name, then:

.test {
height: 300px;
width: 300px;
margin-right: auto;
margin-left: auto;
}

or:

1. go to css styles on the right
2. doubleclick on div's name
3. a window menu will open
4. pick "Box"
5. under "Margin" pick right (auto) left (auto)

Good luck

ranjan
12-28-2010, 07:12 PM
Since its just one swf... do you need a div?

CSS code:


html { height:100% }
body { width: 400px; height: 300px; margin: auto; /*centers vertically and horizontally*/}


Html code:


<!doctype html>
<html><body><!--swf file embedded here--></body></html>

shogun rua
12-28-2010, 08:12 PM
Hi,

Thx for the reply i tried it but its still not centred,anymore options?

Cheers

Paul

here is the domain name http://www.pwtile.co.uk/



Give the div a name, then:

.test {
height: 300px;
width: 300px;
margin-right: auto;
margin-left: auto;
}

or:

1. go to css styles on the right
2. doubleclick on div's name
3. a window menu will open
4. pick "Box"
5. under "Margin" pick right (auto) left (auto)

Good luck

gigiloumill
12-28-2010, 08:13 PM
please post your code..

shogun rua
12-28-2010, 08:16 PM
Hi,

Cheers for the reply, i tried your way also to no avail anymore tips?

Cheers

Paul

http://www.pwtile.co.uk/

Since its just one swf... do you need a div?

CSS code:


html { height:100% }
body { width: 400px; height: 300px; margin: auto; /*centers vertically and horizontally*/}
Html code:


<!doctype html>
<html><body><!--swf file embedded here--></body></html>

shogun rua
12-28-2010, 11:00 PM
Hi,

Sorry i missed your post about the code, how do you post the code in those boxes?:roll:

Thanks again

Paul

<!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>
<link rel="shortcut icon" href="http://img.photobucket.com/albums/v724/leahstoys/shop72/faviconico.jpg" type="image/x-icon"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pw tiling</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<style type="text/css">
<!--
.swf {
margin-right: auto;
margin-left: auto;
height: 300px;
width: 400px;
}
-->
</style>
</head>

<body>
<div id="swf">
<p>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','899','heigh t','488','src','tile','quality','high','pluginspag e','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','tile' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="899" height="488">
<param name="movie" value="tile.swf" />
<param name="quality" value="high" />
<embed src="tile.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="899" height="488"></embed>
</object></noscript>
</p>
</div>
</body>
</html>

shogun rua
12-28-2010, 11:02 PM
I have no idea how that happy icon got in my code lol


Hi,

Sorry i missed your post about the code, how do you post the code in those boxes?:roll:

Thanks again

Paul

<!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>
<link rel="shortcut icon" href="http://img.photobucket.com/albums/v724/leahstoys/shop72/faviconico.jpg" type="image/x-icon"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>pw tiling</title>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<style type="text/css">
<!--
.swf {
margin-right: auto;
margin-left: auto;
height: 300px;
width: 400px;
}
-->
</style>
</head>

<body>
<div id="swf">
<p>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','899','heigh t','488','src','tile','quality','high','pluginspag e','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','tile' ); //end AC code
</script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="899" height="488">
<param name="movie" value="tile.swf" />
<param name="quality" value="high" />
<embed src="tile.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="899" height="488"></embed>
</object></noscript>
</p>
</div>
</body>
</html>

gigiloumill
12-29-2010, 01:18 AM
it should work. fix your size: width="899" height="488

edbr
12-29-2010, 02:44 AM
<div id="swf"> is wrong it must be div class='swf"> as you define as .swf id would be #swf

for code tags go to advanced and use the # symbol
are you sure ranjan's option didnt work?

shogun rua
12-29-2010, 11:31 AM
Hi,

Thanks very much, when i changed the div to a class and left the # in it worked.

Thanks

Paul




<div id="swf"> is wrong it must be div class='swf"> as you define as .swf id would be #swf

for code tags go to advanced and use the # symbol
are you sure ranjan's option didnt work?

shogun rua
12-29-2010, 11:32 AM
Hi,

Changing the size helped aswell.

Thank you very much.

Cheers

Paul


it should work. fix your size: width="899" height="488

shogun rua
12-29-2010, 11:33 AM
Thanks to everybody how replied.

Cheers

Paul

Corrosive
12-29-2010, 11:38 AM
Try using transparent and then setting the black as your div colour; http://kb2.adobe.com/cps/142/tn_14201.html

shogun rua
12-29-2010, 11:40 AM
Try using transparent and then setting the black as your div colour; http://kb2.adobe.com/cps/142/tn_14201.html

Hi,

Thanks for the reply, i just changed the background in the flash properties
in dreamweaver.

Cheers

Paul