Solved

Can't get CSS Side by Side divs to work with youtube

Posted on 2013-05-15
5
521 Views
Last Modified: 2013-05-15
I have been trying to get css to get 2 divs to show side by side.  While float: left appears to work on most things, it doesn't appear to work with Youtube's Html 5 player.

Link to the actual page.

NOTE: the page dynamically updates based on the video time, so you don't see any side values until about 8 seconds into the video.

Here is the CSS:
div#player {
    width: 640px;
    height: 480px;
    float: left;
    text-align: left;
}
div#content {
    width: 200px;
    float: right;
    text-align: left;
}
.clear { 
    clear: both;
}

Open in new window


Here is the HTML:  (populated by javascript)
<div id="player"></div>
<div id="content"></div>
<div class="clear"></div>

Open in new window


What it looks like and how I want it.
Any ideas?
0
Comment
Question by:hpdvs2
  • 3
  • 2
5 Comments
 
LVL 6

Expert Comment

by:APoPhySpt
ID: 39168177
I'm using firefox latest version, and it displays fine...
but I've seen this kind of issue before, perhaps you are trying to insert 2 divs side by side and there is not enough space for it on the parent container
0
 
LVL 8

Author Comment

by:hpdvs2
ID: 39168225
plenty of space.  Padding/margin/widths are all measured.  there is an extra 20 px to spare.

Any ideas why it might not work in chrome?  or is it just my copy?
0
 
LVL 6

Expert Comment

by:APoPhySpt
ID: 39168242
let me try on chrome
0
 
LVL 6

Accepted Solution

by:
APoPhySpt earned 500 total points
ID: 39168266
try it like this:

<div class="playerContent">
      <div id="player"></div>
</div>
<div id="content"></div>
<div class="clear"></div>

Open in new window


CSS:

.playerContent {
 float: left;
 width: 645px;
 height: 485px;
}

div#player {
    width: 640px;
    height: 480px;   
    text-align: left;
}
div#content {
    width: 200px;
    float: right;
    text-align: left;
}
.clear { 
    clear: both;
}

Open in new window

0
 
LVL 8

Author Closing Comment

by:hpdvs2
ID: 39168347
Worked as well as a TD, and it wasn't a TD!  :D
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

830 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