Solved

Problem with centering the display content using Colorbox

Posted on 2011-09-07
4
222 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

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!
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this Micro Tutorial users will learn how to embed custom fonts into websites using @font-face in CSS Select a font: Ensure the EULA allows you to use @font-face: Download the font: Get the browser-compatible files you need: Edit your CSS       - Name …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

757 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

17 Experts available now in Live!

Get 1:1 Help Now