?
Solved

Problem with centering the display content using Colorbox

Posted on 2011-09-07
4
Medium Priority
?
238 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 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
Suggested Courses

839 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