Solved

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

Posted on 2013-05-15
5
518 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now