I am setting up an ID card printing software in PHP both for landscape and portrait mode. The problem is with the print() command it always takes the standard page sizes A4, A3... Because of this it prints the id in a specific section of the card.
Can anyone help or recommend something? Perhaps there is another way to print it without print preview in chrome?
<style>
#page {
/*size: A5;
margin: 5px;*/
width: 53.98mm;
height: 85.60mm;
margin: 0px;
}
#media print {
html, body {
/*width: 210mm;
height: 297mm;*/
/*width: 218mm;
height: 340mm;*/
}
}
#printablediv {
width: 53.98mm;
height: 85.60mm;
}
.idcardreport {
font-family: arial;
-webkit-print-color-adjust: exact;
}
/*IDcard Front Part Css Code*/
.idcardreport-frontend{
margin: 2px;
float: left;
border: 1px solid #000;
padding: 10px;
width: 260px;
text-align: center;
height:370px;
background-size: 100% 100% !important;
}
.logo img{
width: 50px;
height: 50px;
border: 1px solid #ddd;
margin-bottom: 5px;
}
.pick img{
width: 60px;
height: 80px;
border: 1px solid #ddd;
margin-bottom: 5px;
}
.signe img{
width: 50px;
height: 50px;
border: 1px solid #ddd;
margin-bottom: 5px;
}
h3 {
font-size: 14px;
color: #1A2229;
text-align: center;
}
h2 {
font-size: 10px;
color: #1A2229;
text-align: center;
}
h1 {
font-size: 18px;
color: #1A2229;
text-align: center;
}
p {
text-align: left;
font-size: 12px;
margin-bottom: 0px;
margin-top: 1px;
color: #1A2229;
}
.vertical{
writing-mode:tb-rl;
-webkit-transform:rotate(180deg);
-moz-transform:rotate(180deg);
-o-transform: rotate(180deg);
-ms-transform:rotate(180deg);
transform: rotate(180deg);
white-space:nowrap;
display:block;
bottom:0;
}
</style>
<style>
#media print {
body * {
visibility: hidden;
}
#section-to-print, #section-to-print * {
visibility: visible;
}
#section-to-print {
position: absolute;
left: 0px;
/*right: -400px;*/
top: 0;
}
}
button.btn.btn-dark {
padding: 10px;
position: relative;
top: -390px;
}
</style>
<button type="button" class="btn btn-dark" onclick="window.print()"><i class="fa fa-print"></i> Print</button>
<div class="wrapper" id="section-to-print"></div> //add ID on the section u want to print
Hi my PHP include is not appearing in my footer and can't figure out why. When I open the include file it works fine. Any suggestions? It is the same navigation code I had for other files, but i just moved it to the footer from a navigation bar at the top of the website. The navigation works in that case.
PHP file:
<div id="footer">
<div id="navigation">
<?php require_once ("navigation.inc.php"); ?>
</div>
</div>
Navigation file:
<div id="navigation">
Home
</div>
CSS file:
#footer {
position: absolute;
clear: left;
height: 60px;
width: 100%;
text-align: center;
line-height: -5px;
padding: 0px 0px 0px 0px;
bottom: 0px;
left: 0px;
margin-top: 50px;
margin-left: auto;
margin-right: auto;
overflow: hidden;
background-color: green;
#navigation {
font-size: 125%;
padding: 5px;
bottom: 0px;
position: absolute;
width: 100%;
height: 40px;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
#navigation a {
color: black;
padding: 0px 5px 0px 5px;
margin: 0px 5px 0px 5px;
text-decoration: none;
text-align: center;
}
#navigation a:hover {
background-color: #FF8B27;
}
I have created a div that loads hrefs using jquery .load function.
When you mouseenter over an href it loads another popup div using .load.
Everything appears normal when 1 div (with the dates) is loaded see pic(show1) enter image description here
But when I load a second div of dates the popup gets all distorded see pic(show2)enter image description here
Any ideas why this is happening?
Thanks.
This is the code that loads the divs with the hrefs:
<script>
$(document).ready(function(){
$("#left1");
});
</script>
<script>
$(document).ready(function(){
$("#center1");
});
</script>
<script>
$(document).ready(function(){
$("#center2");
});
</script>
<script>
$(document).ready(function(){
$("#center3").load("2016_select_paycheck_to_view.php");
});
</script>
<script>
$(document).ready(function(){
$("#center4").load("2015_select_paycheck_to_view.php");
});
</script>
#center3 {
border-top: 1px solid green;
border-bottom : 1px solid green;
border-left : 0px solid green;
border-right : 1px solid green;
background-color: #FDF5E6;
display: inline-table;
width: 190px;
height: 480px;
}
m3
{
font-family: calibri;
color: black;
font-size: 1em;
text-align: left;
border-top: 2px solid #4d4d4d;
border-left: 2px solid #4d4d4d;
border-right: 0px solid #4d4d4d;
position: relative;
top: 0px;
left: 0px;
padding: 0.2em;
margin-bottom: 0px;
margin-left: 0px;
width: 78px;
line-height: 0.8em;
}
m3t
{
font-family: arial black;
color: white;
font-size: 1em;
text-align: center;
border-top: 3px solid #8A0800;
border-left: 1px solid #8A0800;
border-right: 1px solid #8A0800;
border-bottom: 3px solid #8A0800;
position: relative;
left: 2px;
padding-top: 0.4em;
padding-bottom: 0.4em;
padding-left: 0.1em;
margin-bottom: 0px;
width: 79px;
line-height: 85%;
background-color: #8A0800;
}
m3b
{
font-family: arial black;
color: white;
font-size: 1em;
text-align: center;
border-top: 3.3px solid #8A0800;
border-left: 1px solid #8A0800;
border-right: 1px solid #8A0800;
border-bottom: 3.3px solid #8A0800;
position: relative;
left: 2px;
padding-top: 0.4em;
padding-bottom: 0.4em;
padding-left: 0.1em;
margin-top: 0.8px;
width: 79px;
line-height: 85%;
background-color: #8A0800;
}
#center4 {
border-top: 1px solid green;
border-bottom : 1px solid green;
border-left : 0px solid green;
border-right : 1px solid green;
background-color: #FDF5E6;
width: 190px;
height: 480px;
}
m4
{
font-family: calibri;
color: black;
font-size: 1em;
text-align: left;
border-top: 2px solid #4d4d4d;
border-left: 2px solid #4d4d4d;
border-right: 0px solid #4d4d4d;
display: block;
float: left;
clear: both;
position: relative;
top: 0px;
left: 0px;
padding: 0.2em;
margin-bottom: 0px;
margin-left: 0px;
width: 78px;
line-height: 0.8em;
}
m4t
{
font-family: arial black;
color: white;
font-size: 1em;
text-align: center;
border-top: 3px solid #8A0800;
border-left: 1px solid #8A0800;
border-right: 1px solid #8A0800;
border-bottom: 3px solid #8A0800;
display: block;
float: left;
clear: both;
position: relative;
left: 2px;
padding-top: 0.4em;
padding-bottom: 0.4em;
padding-left: 0.1em;
margin-bottom: 0px;
width: 79px;
line-height: 85%;
background-color: #8A0800;
}
m4b
{
font-family: arial black;
color: white;
font-size: 1em;
text-align: center;
border-top: 3.3px solid #8A0800;
border-left: 1px solid #8A0800;
border-right: 1px solid #8A0800;
border-bottom: 3.3px solid #8A0800;
display: block;
float: left;
clear: both;
position: relative;
left: 2px;
padding-top: 0.4em;
padding-bottom: 0.4em;
padding-left: 0.1em;
margin-top: 0.8px;
width: 79px;
line-height: 85%;
background-color: #8A0800;
}
<div id="firstwrapper">
<div id="left1"> 2019 </div>
<div id="center1"> 2018 </div>
<div id="center2"> 2017 </div>
<div id="center3"> 2016 </div>
<div id="center4"> 2015 </div>
</div>
This is the code that loads the popup divs:
$(function() {
$("a#trigger").mouseenter(function () {
$("div#pop-up").clearQueue();
$("div#pop-up").show();
});
$("a#trigger").mouseleave(function () {
$("div#pop-up").delay(60).slideUp();
});
$("div#pop-up").mouseenter(function () {
$(this).clearQueue();
});
$("div#pop-up").mouseleave(function () {
$(this).delay(200).slideUp();
});
$("a#trigger").mousemove(function(){
var x = $("#center3").offset();
if(x.top > 400, x.left > 9) {
var moveDown = 200;
var moveLeft = -200;
$("div#pop-up").css('top', x.top + moveDown).css('left', x.left + moveLeft);
} else if(x.top > 600, x.left > 40) {
var moveDown = 200;
var moveLeft = -200;
$("div#pop-up").css('top', x.top + moveDown).css('left', x.left + moveLeft);
} else {
var moveDown = 200;
var moveLeft = -200;
$("div#pop-up").css('top', x.top + moveDown).css('left', x.left + moveLeft);
}
});
<style type="text/css">
#secondwrapper {
border: 0px dashed red; /* black */
background: transparent;
position: relative;
left: 0px;
top: 0px;
z-index: 20;
width: 190px;
height: 480px;
}
#middle1 {
border: 1px dashed teal;
width: 190px;
height: 480px;
display: block;
clear: both;
float: left;
position: absolute;
left: 0px;
top: 0px;
margin-top: 0px;
margin-bottom: 20px;
background-color: #FDF5E6;
}
m1year
{
font-family: arial;
color: black;
font-weight: 700;
font-size: 0.9em;
text-align: left;
border: 1px dotted red;
display: block;
float: left;
clear: both;
position: relative;
top: 0px;
left: 0px;
padding: 0.3em;
width: 50px;
height: 8px;
line-height: 0.7em;
background-color: transparent;
}
m1
{
font-family: calibri;
color: #8c0000;
font-size: 1em;
text-align: left;
border-top: 1px solid black;
border-left: 1px solid black;
border-right: 1px solid black;
display: block;
float: left;
clear: both;
position: relative;
top: 0px;
left: 0px;
padding: 0.36em;
margin-bottom: 0em;
margin-left: 10px;
width: 155px;
height: 5px;
line-height: 4.3px;
background-color: white;
}
a:link {
text-decoration: none;
color: #8c0000;
}
a:visited {
color: #8c0000;
} /* visited link */
a:hover {
color: red;
} /* mouse over link */
div#pop-up {
display: none;
position: absolute;
left: 100px;
z-index: 30;
width: 550px;
height: 600px;
background: transparent;
color: #000000;
border: 0px dashed #ff6600; /* ORANGE */
}
</style>
<script>
$(document).ready(function(){
$("#pop-up").load("2016_dump_expenses_sums_PER_PAYCHECK_DYNAMIC.php? THURSDAY=<?PHP echo ($array0); ?>&WEDNESDAY=<?PHP echo ($array13); ?>&pay=<?PHP echo (958); ?>" ); });
</script>
<div id="secondwrapper">
<div id="middle1"
<m1year> 2016 </m1year>
<m1>
<A HREF="2016_dump_expenses_sums_PER_PAYCHECK_DYNAMIC.php?THURSDAY=<?PHP echo ($array0); ?>&WEDNESDAY=<?PHP echo ($array13); ?>&pay=<?PHP echo (958); ?> "
TARGET="mainFrame" id="trigger">
<?PHP
print ("$newMonth1");
print (" ");
print ("$newDay1");
print (" ");
print ("-");
print (" ");
print ("$newMonth1a");
print (" ");
print ("$newDay1a");
?>
</A></m1>
</div>
</div>
<div id="pop-up"> </div>
<div id="pop-up2"> </div>
<div id="pop-up3"> </div>
<div id="pop-up4"> </div>
Ok I think I fixed it. It was my css I removed some divs and it appears to be working ok now.
Please, show us the markup and css you're using: it looks like something inherent to css issue.
I've been designing my site re-learning CSS after taking a long time, and have been essentially creating a website (integrated with WordPress) by basically doing as little as possible with the HTML/PHP, and trying to design it all from the CSS and available CLASS and IDs setup for me by a template theme. (Blankslate Theme)
This entire time it's been coming along fine in Chrome. I decided before I got too far to check it out on Firefox. Firefox decides everything should be squished to the LEFT, while in Chrome the site looks perfectly centered and matches things I try to do in the CSS.
I tried to align both the WRAPPER, Body, and even HTML to center the entire page, but Firefox refuses to do so. My fixed sidebar on the right is suppose to be spaced away from the main content, which it is in Chrome (unless you increase the size of the entire page, then it overlaps.) In Firefox, it doesn't even try to go as far right as possible, it just squishes in with everything else.
I've also wanted to use Ellipsis to cut off the text in the Sidebar if it's too long, however it refuses to work. It either cuts the text off, but does not substitute ellipsis, or runs off the page.
Below is the structure I'd like:
http://www.icesage.com/i/site2.png
Here is the CSS I'm using. As for the PHP/HTML structure you'll need to go to the actual website itself as there are too many to show here. (Again, it's WordPress, and uses the theme Blankslate as a starting point.)
body {
background-color: black;
background-repeat:no-repeat;
background-attachment:fixed;
background-size: 110%;
line-height: 20px;
text-size: 10px;
font-family: Verdana;
}
#site-title {
position:relative;
top:0px;
margin: 0 auto;
width: 10%;
display:none;
}
/* #header {
position:relative;
top:0px;
margin: 0 auto;
width: 40%;
} */
#footer {
position: relative;
float: right;
bottom: 0;
margin: 2% auto;
right: 25%;
width: 50%;
height: 10px; /* Height of the footer */
background-color:rgba(0,0,0,0.7);
border-radius: 10px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
text-align: center:
padding-top: 5px;
padding-bottom: 9px;
padding-right: 5px;
padding-left: 5px;
display: inline
}
#copyright {
text-align: center;
}
/* Top Navigation */
#menu {
margin: 0 auto;
}
#menu a {
float: left;
color: white;
display: block;
height: 40px;
line-height: 40px;
text-decoration: none;
text-align: center;
margin-right: 10px;
border-left-style: solid;
border-width: 1px;
border-color: #1c6191;
background-color:rgba(0,0,0,0.9);
border-radius: 10px;
box-shadow: 4px 0px 2px 3px #1c6191;
padding-top: 0px;
padding-bottom: 0px;
padding-right: 15px;
padding-left: 15px;
}
#menu a:hover {
background-color: blue;
}
.entry-title {
font-size: large;
width:60%;
text-shadow: 2px 0.5px #1c6191;
background-color:rgba(0,0,0,0.7);
border-radius: 20px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
padding-top: 5px;
padding-bottom: 5px;
padding-right: 5px;
padding-left: 5px;
margin: 2px
}
/* h1 .entry-title {
display: none;
font-size: 50px;
}
h2 .entry-title {
display:none;
font-size: 50px;
}
h3 .entry-title {
font-size: 50px;
text-shadow: 2px 0.5px #1c6191;
}
h3 .widget-title {
font-size: 50px;
text-shadow: 2px 0.5px #1c6191;
}
*/
.cat-links {
display:none;
}
/* Main Content Post (Entry) */
.post {
width: 70%;
background-color:rgba(0,0,0,0.9);
border-radius: 20px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 50px;
padding-left: 50px;
margin: 30px;
margin-left: 5px;
}
img.alignright {float:right; margin:20px 10 10em 10em; background-color: royalblue; border: 1px;}
img.alignleft {float:left; margin:20px 10em 2em 2em;}
img.aligncenter {display: block; margin-left: auto; margin-right: auto}
.alignright {float:right; text-align:center; padding-left: 20px;}
.alignleft {float:left; }
.aligncenter {display: block; margin-left: auto; margin-right: auto}
.wp-caption-text {
font-size: small;
font-style:italic;
text-align:center;
}
.post-edit-link {
float: left;
color: white;
position: relative;
display: block;
height: 40px;
line-height: 40px;
text-decoration: none;
text-align: center;
margin-right: 10px;
border-left-style: solid;
border-width: 1px;
border-color: #1c6191;
background-color:rgba(0,0,0,0.9);
border-radius: 10px;
box-shadow: 4px 0px 2px 3px #1c6191;
padding-top: 0px;
padding-bottom: 0px;
padding-right: 15px;
padding-left: 15px;
}
.post-edit-link:hover {
background-color: blue;
}
.comments-link {
float: right;
color: white;
display: block;
position: relative;
height: 40px;
line-height: 40px;
text-decoration: none;
text-align: center;
margin-right: 10px;
border-left-style: solid;
border-width: 1px;
border-color: #1c6191;
background-color:rgba(0,0,0,0.9);
border-radius: 10px;
box-shadow: 4px 0px 2px 3px #1c6191;
padding-top: 0px;
padding-bottom: 0px;
padding-right: 15px;
padding-left: 15px;
}
.comments-link:hover {
background-color: blue;
}
.type-page {
width: 70%;
float: left;
background-color:rgba(0,0,0,0.9);
border-radius: 20px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 50px;
padding-left: 50px;
margin: 40px
overflow: auto;
}
.nav-previous {
display: none;
}
.comments {
width: 70%;
float: left;
background-color:rgba(0,0,0,0.9);
border-radius: 20px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 50px;
padding-left: 50px;
margin: 20px
}
.comment {
width: 70%;
float: left;
background-color:rgba(0,0,0,0.9);
border-radius: 20px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 50px;
padding-left: 50px;
margin: 20px
}
#header {
width: 60%;
margin: 0 auto;
background-color:rgba(0,0,0,0.7);
border-radius: 20px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 50px;
padding-left: 50px;
margin-bottom: 40px;
}
#titlebanner {
margin: 0 auto;
}
.meta-sep {
display: none;
}
html {
zoom: .8;
-moz-transform: scale(0.8);
-moz-transform-origin: 0 0;
margin: 20px auto;
}
.comment-respond {
color: white;
width: 60%;
float: left;
background-color:rgba(0,0,0,0.7);
border-radius: 20px;
margin: 0 auto;
box-shadow: 5px 0px 4px 0px #1c6191;
font-color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 50px;
padding-left: 50px;
}
.entry-date {
color: royalblue;
}
#wrapper {
-moz-margin-start: -40px auto;
margin-right: 0 auto;
}
/* Sidebar */
.widget-area {
position: fixed;
top: 225px;
z-index: 1;
right: 0.5%;
text-shadow: 2px 2px #1c6191;
width: 300px;
float:left;
border-left-style: solid;
border-width: 1px;
border-color: #1c6191;
background-color:rgba(0,0,0,0.9);
border-radius: 10px;
box-shadow: 4px 0px 2px 3px #1c6191;
color: white;
padding-top: 0px;
padding-bottom: 0px;
padding-right: 0px;
padding-left: 0px;
margin-right: inherit;
}
.xoxo {
display:block;
padding-top: 2px;
padding-bottom: 2px;
padding-right: 2px;
padding-left: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: clip
text-overflow: ellipsis
text-overflow: "…"
}
#searchsubmit {
display:none;
}
.searchform .screen-reader-text {
display:none;
}
.xoxo .screen-reader-text {
display:none;
}
.entry-content {
width: 90%;
color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 25px;
padding-left: 25px;
text-align:justify;
/* text-shadow: 2px 0.5px #1c6191; */
}
P {
color: white;
}
#search {
display:none
}
#site-description {
display:none
}
A {
text-decoration: none;
font-family:Verdana;
}
A:link {
text-decoration: none;
color:#04CCFD;
font-family:Verdana;
}
A:visited {
text-decoration: none;
color:#04CCFD;
font-family:Verdana;
}
A:active {text-decoration: none;
color:#04CCFD;
}
A:hover {
text-decoration: none;
color:white;
}
li .widget-container {
font-color: white;
}
/* Sub-Menu Test */
/* End Sub-Menu Test */
video{font-size:100%;font:inherit;padding:0;border:0;margin:0;vertical-align:baseline}
ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}
table{border-collapse:collapse;border-spacing:0}
section{display:block}
.clear{clear:both}
.sticky{}
.bypostauthor{}
.wp-caption{}
.wp-caption-text{}
.gallery-caption{}
.alignright{}
.alignleft{}
.aligncenter{}
Website: http://www.icesage.com
Or you can take a look at "Blankslate."
Any help in figuring out what I'm doing wrong or pointing out some sloppy code would be appreciated, but the main question for this post is:
How can I contain everything in the wrapper properly and have the entire site centered, including the sidebar, in all browsers (especially Firefox) like how it appears in Chrome? (Additionally, some of the layout was done accidentally, like the Comment & TopNav buttons appearing slightly off the previous area. Which I want to keep, but I'm not sure how to properly keep it that way.)
I searched thoroughly and the answers provided keep telling me the appropriate CSS to use, and I keep using it to no avail. Other questions are simply left unanswered.
Any help would be appreciated!
The problem is coming from the way you used transform-origin for firefox browser. Look at the following class
html {
zoom: .8;
-moz-transform: scale(0.8);
-moz-transform-origin: 0 0;
margin: 20px auto;
}
As you mentioned "0 0" for origin property. The first value is the horizontal position, the second value is the vertical. So it aligned to left and top position. If you want horizontally center the page then you need to give "center, top" or "50%,0". Update your CSS like below.
html {
zoom: .8;
-moz-transform: scale(0.8);
-moz-transform-origin:50% 0;
margin: 20px auto;
}
Additional Question asked by OP in the comment box:
do you know why the sidebar is still condensed and overlapping the content on the left, when it doesn't do that in Chrome?
This issue came because the default behavior of chrome and firefox. Look at the following class.
.post {
width: 70%;
background-color:rgba(0,0,0,0.9);
border-radius: 20px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 50px;
padding-left: 50px;
margin: 30px;
margin-left: 5px;
}
The default chrome property for box-sizing:border-box and firefox is box-sizing:content-box. This is causing the problem. Check what is the difference between these to here
So force firefox to use border-box property for box-sizing. Update the CSS like below.
.post {
width: 70%;
background-color:rgba(0,0,0,0.9);
border-radius: 20px;
box-shadow: 5px 0px 4px 0px #1c6191;
color: white;
padding-top: 25px;
padding-bottom: 25px;
padding-right: 50px;
padding-left: 50px;
margin: 30px;
margin-left: 5px;
-moz-box-sizing:border-box;
}
The site looks in Chrome exactly as it looks in Firefox. Because of this here:
margin-right: 0 auto;
which is an invalid property for margin-right. You want
margin: 0 auto;
My "Page [0]" text isn't centered on my webpage. Anyone know why? I could really use some help please.
Here is the html:
<html>
<head>
<title>Test Forum</title>
<link href="http://prime.programming-designs.com/test_forum/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<img src="http://prime.programming-designs.com/test_forum//images/banner1.png" alt="" id="banner" />
<h1>Test Forums</h1>
<hr />
<div id="navi"><div id="naviheader">Boards</div>Testing<br />General Discussion<br />Video Games<br />Anime and Manga<br />BlazBlue<br />Shin Megami Tensei<br />Earthbound<br />Phantasy Star<br />Mobile Suit Gundam<br /></div>
<div class="postbox"><h4>CyanPrime</h4><hr />Welcome to the King's Gate BBS!</div>Page: [0]
</body>
</html>
Here is the CSS:
#charset "windows-1252";
body{
background-color: #EEFFF8;
color: #000000;
text-align: center;
}
.postbox{
text-align: left;
margin: auto;
background-color: #dbfef8;
border: 1px solid #82FFCD;
width: 50%;
margin-top: 10px;
}
.stickypostbox{
text-align: left;
margin: auto;
background-color: #F5FFFA;
border: 1px solid #82FFCD;
width: 50%;
margin-top: 10px;
}
h4{
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
color: #9932CC;
}
h1{
color: #551A8B;
}
hr{
color: #82FFCD;
background-color: #82FFCD;
height: 1px;
border: 0px dotted #82FFCD;
}
a{
color: #7F00FF;
text-decoration: none;
}
a:hover{
color: #7F00FF;
text-decoration: underline;
}
form{
margin: 0px auto;
width: 50%;
}
#formdiv {
background-color:#dbfef8;
border:1px solid #82FFCD;
}
.fielddiv1{
background-color: #f9f9f9;
border: 1px solid #DBFEF8;
vertical-align: middle;
width: 45%;
float: left;
}
.fielddiv2{
background-color: #f9f9f9;
border: 1px solid #DBFEF8;
vertical-align: middle;
width: 100%;
}
.fieldtext1{
width: 50%;
background-color: #82FFCD;
float: left;
}
.fieldtext2{
width: 100%;
background-color: #82FFCD;
}
#replydiv{
width: 100%;
background-color: #DBFEF8;
margin: 10px 0 10px 0;
}
#admindiv{
width: 100%;
background-color: #DBFEF8;
margin: 10px 0 10px 0;
}
#navi{
width: 200px;
background-color: #dbfef8;
border: 1px solid #82FFCD;
text-align: left;
float: left;
}
#naviheader{
width: 100%;
background-color: #82FFCD;
}
#submitbutton{
border: 1px solid #82FFCD;
background-color: #DBFEF8;
color: #000000;
margin-top: 5px;
width: 100px;
height: 20px;
}
#banner{
border: 1px solid #82FFCD;
}
.postbar{
margin-right: 0px;
margin-top: 0px;
}
.bannedtext{
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
color: #FF0000;
}
And here is the webpage so you can get some context (you'll notice that my "page [0]" is centered on the other boards, but not the index. http://prime.programming-designs.com/test_forum/
The float on the left is pushing the content to the right. It's still centred across the line, but it's not centred across the page. Adding a large bottom margin to .postbox illustrates this.
Centreing problem illustrated http://img169.imageshack.us/img169/9027/williamhtmlproblem.png
My suggestion would be to wrap the footer in a <div>. Either clear: both; (or just left), add margins on either end to compensate for the floated element, or give it position: absolute; left: 0; right: 0; to force centreing across the page.
Change:
Page: [0]
To (wrap it in a div with pager class):
<div class="pager">Page: [0]</div>
Change this in your CSS:
.postbox, .pager{
text-align: left;
margin: auto;
width: 50%;
margin-top: 10px;
}
.postbox {
background-color: #dbfef8;
border: 1px solid #82FFCD;
}
.pager {
text-align: center;
}
The reason this is happening is because your float is pushing over your content. You pager is coming straight off the body tag. In general, it's best to wrap plain text inside an html element.
You may want to revisit the structure of your page. Create a left column and a center column div or something like that.