Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Using Paint, find the number of pixels there are from the top of the background image to the top of the TV in the background image. This is your topDistance.</p> <p>Again using Paint, find the number of pixels there are from the left of the background image to the left of the TV in the background image. This is your leftDistance.</p> <p>Now, apply these CSS rules to the video container <code>&lt;div&gt;</code>:</p> <pre><code>position: absolute; top: (topDistance)px; /* replace (topDistance) with the distance you found earlier*/ left: (leftDistance)px; /* replace (leftDistance) with the distance you found earlier */ </code></pre> <p>Sample:</p> <pre><code>div.video { position: absolute; top: 100px; left: 50px; } </code></pre> <p>where the video is placed 100px from the top of the browser and 50px from the left of the browser. Make sure to use pixels in this case because different browsers will interpret % distances differently, depending on your parent <code>div</code>s and the window size.</p> <p>Take the parent <code>div</code> that contains the background image and apply a <code>position: relative;</code> rule. Although <code>position: relative;</code> keeps the <code>div</code>'s behavior the same, it allows you to put the video in relation to the <code>div</code>. Consider your options for height/width of the <code>div</code>, and the background-size, as well: the browsers' interpretation of %/cover for those tags, respectively, depends on its parent <code>div</code>s and the window size as well. Sometimes the browsers do unexpected things with %/cover and inheritance.</p> <p><a href="http://jsfiddle.net/RoyalleBlue/6D87p/1/" rel="nofollow">Fiddle here.</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload