Solved

How to increase spacing between two DIV elements

Posted on 2010-11-15
3
420 Views
Last Modified: 2012-05-10
Hello,

I'm having issues getting adequate spacing between two DIV elements.  I want to put more space between the <div class="yt_holder"> and the <div id="ytvideo2"></div>.  Any ideas on the best way to accomplish this?


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="jquery.youtubeplaylist.js"></script>

<script type="text/ecmascript">
	
		$(function() {
			$("ul.demo2").ytplaylist({addThumbs:true, autoPlay: false, holderId: 'ytvideo2', allowFullScreen:true});
		});
	
</script>

<style type="text/css">
.demo2 {
float:left;
margin:0;
padding:0;
width:220px;
height:300px;
overflow-x:hidden;
overflow-y:scroll;
}
#ytvideo2 {
    float: left;
	margin-right:10px;
}
.yt_holder {
    background: #f3f3f3;
    padding: 10px;
    float: left;
    border: 1px solid #e3e3e3;
	margin-bottom:15px;
}
ul {
    float: left;
    margin: 0;
    padding: 0;
    width: 220px;
}
ul li {
    list-style-type: none;
    display:block;
    background: #f1f1f1;
    float: left;
    width: 216px;
    margin-bottom: 5px;
	padding:2px;

}
ul li img {
    width: 120px;
    float: left;
    margin-right: 5px;
    border: 1px solid #999;
}
ul li a {
    font-family: georgia;
    text-decoration: none;
    display: block;
    color: #000;
}
.currentvideo {
	background: #ffccff;
}	
</style>
</head>
<body>
	<div id="page">           
    <div class="yt_holder">
        <ul class="demo2">
            <li><a href="http://www.youtube.com/watch?v=8xg3vE8Ie_E">Video 1</a></li>
            <li><a href="http://www.youtube.com/watch?v=Pb-K2tXWK4w">Video 2</a></li>
            <li><a href="http://www.youtube.com/watch?v=Jb2stN7kH28">Video 3</a></li>
			 <li><a href="http://www.youtube.com/watch?v=8xg3vE8Ie_E">Video 4</a></li>
            <li><a href="http://www.youtube.com/watch?v=Pb-K2tXWK4w">Video 5</a></li>
            <li><a href="http://www.youtube.com/watch?v=Jb2stN7kH28">Video 6</a></li>
			 <li><a href="http://www.youtube.com/watch?v=8xg3vE8Ie_E">Video 7</a></li>
            <li><a href="http://www.youtube.com/watch?v=Pb-K2tXWK4w">Video 8</a></li>
            <li><a href="http://www.youtube.com/watch?v=Jb2stN7kH28">Video 9</a></li>
        </ul>
		<div id="ytvideo2"></div>
    </div>   
    </div>
</body>
</html>

Open in new window

0
Comment
Question by:cgray1223
[X]
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
3 Comments
 
LVL 18

Accepted Solution

by:
Sudaraka Wijesinghe earned 167 total points
ID: 34142921
Use margin-left on #ytvideo2
#ytvideo2 {
float:left;
margin-right:10px;

margin-left:20px;
}

Open in new window

0
 
LVL 2

Assisted Solution

by:wasim117
wasim117 earned 166 total points
ID: 34142942
increase the padding of .yt_holder. here is 20px

.yt_holder {
background:none repeat scroll 0 0 #F3F3F3;
border:1px solid #E3E3E3;
float:left;
margin-bottom:15px;
padding:20px;
}

Open in new window

0
 
LVL 7

Assisted Solution

by:armchang
armchang earned 167 total points
ID: 34142976
Hi,

One way to do this is define another
<div style="width:20px;height:100%;"></div>

Open in new window

tags between the <ul> and the <div id="ytvideo2"> tags and set the float:right; for the ytvideo2. That way, you always have a fixed spacing on the center between the links and the video.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

759 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