Solved

Float YouTube Embedded Video

Posted on 2010-08-18
6
750 Views
Last Modified: 2012-06-21
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
Comment
Question by:nsitedesigns
  • 2
  • 2
  • 2
6 Comments
 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 100 total points
ID: 33466846
You need to declare a width on the floated element.
0
 

Author Comment

by:nsitedesigns
ID: 33466897
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
 
LVL 4

Accepted Solution

by:
Morrisproject earned 400 total points
ID: 33466912
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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 33466915
Right now I don't see a div tag for the video on index_new.asp...
0
 

Author Comment

by:nsitedesigns
ID: 33466954
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
 
LVL 4

Expert Comment

by:Morrisproject
ID: 33467191
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This video teaches users how to migrate an existing Wordpress website to a new domain.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question