Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 770
  • Last Modified:

Float YouTube Embedded Video

I am trying to float a YouTube embedded video on my site.  I surrounded video with a div tag but it is still not working.  What am I doing wrong?

http://myrockyknoll.com/index_new.asp

 #video_new
 {
 z-index:1;
 float:right;
 }
<div class="video_new"><object width="300" height="224" class="video"><param name="movie" value="http://www.youtube.com/v/kUGnrQLU7mw?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/kUGnrQLU7mw?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="224"></embed></object>
   </div>

Open in new window

0
nsitedesigns
Asked:
nsitedesigns
  • 2
  • 2
  • 2
2 Solutions
 
Jason C. LevineNo oneCommented:
You need to declare a width on the floated element.
0
 
nsitedesignsAuthor Commented:
Nope.  That didn't work.  : (
      

http://myrockyknoll.com/index_new.asp
http://myrockyknoll.com/rk.css
#video_new
 {
 z-index:1;
 float:right;
 width:300px;
 }

Open in new window

0
 
MorrisprojectCommented:
ok.... where to start :-)

Firstly on the link, it is in a <p> tag the div you mentioned does not exist on the live page.

Now for your code you have given the div a class, but in your CSS your referring to an ID (#).

Change the CSS to be this:
.video_new
 {
 z-index:1;
 float:right;
width:100%;
text-align:center;
 }

NB: Note the change of # to a (.) instead. You can play with the other properties when it starts to move :-)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jason C. LevineNo oneCommented:
Right now I don't see a div tag for the video on index_new.asp...
0
 
nsitedesignsAuthor Commented:
Morrisproject:  The div tag was there but I was trying to fix it so when you went in to look, maybe it was during my attempt to fix. I did replace the # with a . and that did the trick.  I thought # was for if there was no other instance of this div on the website.
0
 
MorrisprojectCommented:
You are correct if that would be the only instance you can use a #

However, that means the div would be an id, so the HTML would be
<div id="video_new">.....

As it was a class, you need a dot instead, which also means the same properties can be applied to another video in the same class in the page...
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now