3 Replies - 1027 Views - Last Post: 09 May 2009 - 12:13 AM

#1 Lightingbird  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 04-May 09

Need help to learn how to align css code

Post icon  Posted 04 May 2009 - 10:58 PM

Hello all,

I have a slight problem. I created a flash banner that I would like to put on my website. Anytime I put it on my website it is not aligned. I am fairly new to css and need some help. Here is the code:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
id="name" width="160" height="600">
<param name="movie" value="http://www.spartansupport.com/123-banner_com_sky18490.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed name="name" src="http://www.spartansupport.com/123-banner_com_sky18490.swf"
quality="high" wmode="transparent" width="160" height="160"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
P1_Prod_Version=ShockwaveFlash">
</embed>
</object>

I'm trying to align it to the right but I have no idea what the correct line of text should be or where to put it. Can someone help me learn this?

Is This A Good Question/Topic? 0
  • +

Replies To: Need help to learn how to align css code

#2 J0K3R  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 13
  • View blog
  • Posts: 298
  • Joined: 19-December 08

Re: Need help to learn how to align css code

Posted 04 May 2009 - 11:39 PM

Hi. I would suggest creating a div. set the div's float properties to float right then place your flash inside this div. for example:

Below I created a div called "FlashWrapper".
I set its position to relative so the float property will be relative to the block that it is in.
I set the float property to right. So the div that the flash is in will float right thus aligning it to right like you want.

I placed the flash in that div.

Hope it helps. :)

<!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>
<style type="text/css">
.FlashWrapper {
	width:160px;
	height:160px;
	position:relative;
	float:right;
}
</style>

</head>

<body>
	<div class="FlashWrapper">
		<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
		  codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
		  id="name" width="160" height="600">
		  <param name="movie" value="http://www.spartansupport.com/123-banner_com_sky18490.swf">
		  <param name="quality" value="high">
		  <param name="wmode" value="transparent">
		  <embed name="name" src="http://www.spartansupport.com/123-banner_com_sky18490.swf"
		  quality="high" wmode="transparent" width="160" height="160"
		  type="application/x-shockwave-flash"
		pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?
		P1_Prod_Version=ShockwaveFlash">
		  </embed>
		</object> 
	</div>	
</body>
</html>


This post has been edited by J0K3R: 04 May 2009 - 11:41 PM

Was This Post Helpful? 0
  • +
  • -

#3 crazyjugglerdrummer  Icon User is offline

  • GAME OVER. NERD WINS.
  • member icon

Reputation: 124
  • View blog
  • Posts: 690
  • Joined: 07-January 09

Re: Need help to learn how to align css code

Posted 08 May 2009 - 12:46 PM

You can do the same using text-align: right for backward compatibility in cranky old IE. ;D

This post has been edited by crazyjugglerdrummer: 08 May 2009 - 12:46 PM

Was This Post Helpful? 0
  • +
  • -

#4 firebolt  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 93
  • View blog
  • Posts: 5,561
  • Joined: 20-February 09

Re: Need help to learn how to align css code

Posted 09 May 2009 - 12:13 AM

@Lighting Bird, please post your code like this :code:
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1