Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Float YouTube Embedded Video

Posted on 2010-08-18
6
752 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
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…

808 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