Can anyone please tell me how can i keep the whole page in the center of the screen?

please help!!

Recommended Answers

All 7 Replies

that is the work of HTML/CSS. PHP does not know anything about markup and is processed on server!

Using html... you can create a div tag and put the content in it... like

<div id="content" align="center">
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
Member Avatar

centre whole page - easy with a wrapper div about the whole thing:

  text-align: center;
  margin: 0 auto;
  width: 900px;
  text-align: left;

The text-align stuff is probably unnecessary, but I remember problem with IE6 - I think that solved it.

  <div id="wrapper">

Thank you :D

Thanks for your advice i tried that and now tho whole thing is in the middle except one thing that i marked red.

here is the code

<body style = "align:center;">
<!-- helloween div-->
<div id="wrap" onclick="return wrap_onclick()">
<div class="xlabel" style="text-align :right;margin-left:10px;">&nbsp
 <div id="jack" style="visibility:hidden;position:absolute;z-index:3" >
<img src="flying_bat48.gif" style="height:48px;width:48px" alt="fying bat"/>

<div id="container">
        <div id="navigation">
                <li><a HREF="contactUs.php" onMouseOver="playSound(0)" onMouseOut="stopSound(0)"><b>CONTACT US</a></li>  
                <li><a href="javascript:MM_openBrWindow('about.php','','width=470,height=350')" onMouseOver="playSound(0)" onMouseOut="stopSound(0)"><b>ABOUT US</a></li>
                <li><a class="active" HREF="index.php" onMouseOver="playSound(0)" onMouseOut="stopSound(0)"><b>HOME</a></li>

        <div id="nav">
        <div id="current">
            include "connect.php";
            include "type_list.php";

    <!--random screenprinting-->
        <div id="random_Image">
        <script language="JavaScript1.2">

        var clickmessage="ืNot allow to save!!"

        function disableclick(e) {
        if (document.all) {
        if (event.button==2||event.button==3) {
        if (event.srcElement.tagName=="IMG"){
        return false;
        else if (document.layers) {
        if (e.which == 3) {
        return false;
        else if (document.getElementById){
        if (e.which==3&&"IMG"){
        return false

        function associateimages(){

        if (document.all)
        else if (document.getElementById)
        else if (document.layers)
        <a id="imageLink" href="#">
        <img id="image" src="<?php echo "images_small/".$photo_prd ; ?>" alt="" />
<!--end random  screenprinting-->
<!--random bestseller-->
        <div id="random_Image2">
            <a id="imageLink2" href="#">
                <img id="image2" src="<?php echo "images_bestsel/".$photo_prd2 ; ?>" alt="" />
<!--end random bestseller-->
        [COLOR="Red"]<div id ="content_2">
        <a><img src="bestseller.gif"></a>


that red part that i mention above is still on the left.

and here is the css for that

#content_2 {
position: absolute;
top: 293px;
left: 5px;
list-style: none;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.