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
Solved

Problem with centering the display content using Colorbox

Posted on 2011-09-07
4
228 Views
Last Modified: 2012-05-12
Hi,

I have no problem using Colorbox and from their samples, i reduced the code to test out the specific sample that i want (youtube video).  

But i can't work out why the changes i made can cause the content isn't displaying at the center like they have in the sample at the link shown.

I attached my modification, If someone could tell me that would be nice.
 
cbox.zip
0
Comment
Question by:Gerson008
  • 2
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
LZ1 earned 500 total points
ID: 36497638
You need a Doctype on your test.php page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link media="screen" rel="stylesheet" href="colorbox.css" />
	<style type="text/css">
		body{font:12px/1.2 Verdana, sans-serif; padding:0 10px;}
		a:link, a:visited{text-decoration:none; color:#416CE5; border-bottom:1px solid #416CE5;}
		h2{font-size:13px; margin:15px 0 0 0;}
	</style>

	<script src="jquery.min.js"></script>
	<script src="jquery.colorbox.js"></script>
	<script>
		$(document).ready(function(){
			//Examples of how to assign the ColorBox event to elements
			$(".video").colorbox({iframe:true, innerWidth:425, innerHeight:344});
		});
	</script>

</head>
<body>
		<a class='video' href='http://www.youtube.com/embed/617ANIA5Rqs?rel=0&amp;wmode=transparent'>Some youtube video</a>			
</body>
</html>

Open in new window

0
 

Author Comment

by:Gerson008
ID: 36499590
@LZ1 - Thank you! That was trivial.

What's the purpose of the DOCTYPE? Do you know?
0
 

Author Closing Comment

by:Gerson008
ID: 36499862
Good and quick answer, easy point for you!
0
 
LVL 30

Expert Comment

by:LZ1
ID: 36502098
To quote from the HTML 4.01 specification, "A valid HTML document declares what version of HTML is used in the document. The document type declaration names the document type definition (DTD) in use for the document (see ISO8879)." In other words, it's a way of telling the browser which version of HTML you're using. This can be used to say that you're using HTML 3.2, 4.01, or whichever version you use; but it can also be used to describe the particular flavor of HTML you're using.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

828 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