Solved

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

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
CSS Divs in Safari 3 19
JavaScript Scope issue 4 20
jqplot Pie Chart - javascript 2 13
Printing a Google Form 2 8
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

705 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

13 Experts available now in Live!

Get 1:1 Help Now