[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Problem with centering the display content using Colorbox

Posted on 2011-09-07
4
Medium Priority
?
235 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
[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
  • 2
  • 2
4 Comments
 
LVL 30

Accepted Solution

by:
LZ1 earned 2000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
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…
Suggested Courses

656 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