Solved

Help to center template

Posted on 2008-06-24
5
258 Views
Last Modified: 2011-10-03
I'm getting in a mess with this layout! How can I get this layout to center and still all work! html and css below. Thanks
html
<head>
 
<link href="suttons.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
<div id="main">
<div id="suttonlogo">
<div id="topnavtext">Mortgages &#9679; Furniture &amp; Refurbishment &#9679; Guide to Manchester &#9679;  Job Vacancies &#9679; Contact Us</div>
</div><!--suttonlogo end-->
<b class="b1f"></b><b class="b2f"></b><b class="b3f"></b><b class="b4f"></b>
      <div id="content">
          <div class="left">
    <ul class="link_list">
     <li><a href="#">Property for Sale</a></li>
      <li><a href="#">Property for Let</a></li>
      <li><a href="#">Selling your Property</a></li>
      <li><a href="#">Renting your Property</a></li>
      <li><a href="#">Black Management</a></li>
      <li><a href="#">Mortgages</a></li>
      <li><a href="#">Furniture &amp; Refurbishment</a></li>                      
    </ul>
          <div id="orangeband"><span class="property">PROPERTY</span><span class="search">SEARCH</span></div>
               <!-- start module quick_search -->
      <div class="module_quick_search">
        <form name="quick_search"class="searchform quicksearch" method="post" action="index.php?option=com_content&id=38&task=view">
          <!--<h3>Quick Search</h3>-->
          <p class="formLine"> 
            <label for="name"><strong>Min. price:</strong></label>
            <select name="min_price">
              <option value="0">0</option>
              <option value="100000">100K</option>
              <option value="200000">200K</option>
              <option value="300000">300K</option>
              <option value="400000">400K</option>
              <option value="500000">500K</option>
              <option value="650000">650K</option>
              <option value="800000">800K</option>
              <option value="1000000">1M</option>
            </select>
          </p>
          <p class="formLine">
            <label for="name"><strong>Max. price: </strong></label>
            <select name="max_price">
              <option value="100000">100K</option>
              <option value="200000">200K</option>
              <option value="300000">300K</option>
              <option value="400000">400K</option>
              <option value="500000">500K</option>
              <option value="650000">650K</option>
              <option value="800000">800K</option>
              <option value="1000000">1M</option>
              <option value=""selected="selected">No limit</option>
            </select>
          </p>
          <p class="formLine">
            <label for="name"><strong>Bedrooms: </strong></label>
            <select name="num_beds">
              <option value="0" selected="selected">0</option>
              <option value="1">1</option>
              <option value="2">2</option>
              <option value="3">3</option>
              <option value="4">4</option>
              <option value="5">5</option>
              <option value="6">6</option>
              <option value="7">7</option>
              <option value="">No limit</option>
            </select>
          </p>
          <p class="formLine hidden"><strong>Location, Postcode, Keywords: </strong><input name="area_str_0" type="text" id="keywords" class="textbox" value=""/></p>
          <p class="formSubmit">
            <input type="submit"class="formButton"value="Search"/>
          </p>
        </form>
    </div>
    <!-- end module quick_search --> 
          
        </div><!--left end-->   
        <b class="b1d"></b><b class="b2d"></b><b class="b3d"></b><b class="b4d"></b>
          <div class="banner">
          <div id="headertext">
          <span class="bannerproperty">PROPERTY</span><span class="bannerfor">FOR</span><span class="bannersale">SALE</span>
          </div>
        </div><!--banner end-->
        
    <b class="b4d"></b><b class="b3d"></b><b class="b2d"></b><b class="b1d"></b>
    <div id="maincontent"><?php mosMainBody(); ?></div>
    </div>
<b class="b4f"></b><b class="b3f"></b><b class="b2f"></b><b class="b1f"></b>
<div id="footerinfo">&copy; Living Ltd 2008</div>
</div>
</body>
 
 
CSS
 
@charset "utf-8";
/* CSS Document */
/*body template*/
body{background-color:#223289; margin: 0; padding:0;}
#main {width: 920px;height:100%;text-align:center;background-color:#223289;
padding-top:0%; margin: 0 auto;}
#content{width:920px;height:98%;padding:1%;background-color:#fbfeee;}
#content .left{float:left;width:20%;height:98%;background-color:#868686; }
#content .banner{width:100%;height:10%;margin-top:0px;background-color:#FF9900;z-index:2;position:relative; text-align:left;}
.b1f, .b2f, .b3f, .b4f{font-size:1px; overflow:hidden; display:block;}
.b1f {height:1px; background:#fbfeee; margin:0 5px;}
.b2f {height:1px; background:#fbfeee; margin:0 3px;}
.b3f {height:1px; background:#fbfeee; margin:0 2px;}
.b4f {height:2px; background:#fbfeee; margin:0 1px;}
 
.b1c, .b2c, .b3c, .b4c{font-size:1px; overflow:hidden; display:block;}
.b1c {height:1px; background:#868686; margin:0 5px;}
.b2c {height:1px; background:#868686; margin:0 3px;}
.b3c {height:1px; background:#868686; margin:0 2px;}
.b4c {height:2px; background:#868686; margin:0 1px;}
 
.b1d, .b2d, .b3d, .b4d{font-size:1px; overflow:hidden; display:block;}
.b1d {height:1px; background:#FF9900; margin:0 5px;}
.b2d {height:1px; background:#FF9900; margin:0 3px;}
.b3d {height:1px; background:#FF9900; margin:0 2px;}
.b4d {height:2px; background:#FF9900; margin:0 1px;}
/*jen*/
#suttonlogo{
width: 100%;
background:url(images/suttonslogo.gif) no-repeat;
height: 80px;
}
#mainlogo{
width: 192px;
float:left;
background-color:#CC9900;
}
#topmenu{
width:728px;
float:left;
background-color:#33CC00;
}
#topnavtext{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#FFFFFF;
padding: 55px 0px 0px 340px;
text-align:left;
}
/*body template end*/
      ul.link_list {
        margin: 0;
        padding: 0px;
list-style-type: none;
        width: 200px;
		text-align:left;
		padding-bottom: 20px;
      }
      ul.link_list li {
        margin: 0;
        padding: 0;
      }
      ul.link_list a {
        display: block;
        width: 200px;
        height: 20px;
        border-bottom: 1px #FFF solid;
        font-family: Arial, Helvetica, sans-serif;
        font-weight: bold;
        font-size: 12px;
        line-height: 20px;
        padding: 0 5px;
        text-decoration: none;
      }
      ul.link_list a:link, ul.link_list a:visited {
        color: #fff;
        background: #868686;
      }
      ul.link_list a:focus, ul.link_list a:hover {
        color: #FFF;
        background: #777;
      }
      ul.link_list a:active {
      }
      ul.link_list li.color_2 a:link, ul.link_list li.color_2 a:visited {
        color: #fff;
        background: #7D7B7C;
      }
      ul.link_list li.color_2 a:focus, ul.link_list li.color_2 a:hover {
        color: #FFF;
        background: #777;
      }
      ul.link_list li.color_2 a:active {
        color: #fff;
        background: #7D7B7C;
      }
	        ul.link_list li.color_2 a:hover{
        color: #fff;
        background: #D0D0D0;
      }
 
	  /*nav end*/
#productheader{
width: 140px;
height: 35px;
background:url('images/pinkproducts.gif') no-repeat;
}
#leftnav{
background-color:#fff;
width: 140px;
padding: 0px 0px 0px 0px;
float:left;
}
 
#orangeband{
width: 200px;
height: 35px;
background-color:#FF9D1C;
padding: 10px 0 0 10px;
text-align:left;
}
.property{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
font-weight:bold;
color:#000066;
}
.search{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
font-weight:bold;
color:#ffffff;
}
#headertext{
width: 300px;
padding: 25px 0 0 10px;
}
.bannerproperty{
font-family:Arial, Helvetica, sans-serif;
font-size:16px;
font-weight:bold;
color:#000066;
text-align:left;
padding: 0px 0 0 20px;
margin: 0;
}
.bannerfor{
font-family:Arial, Helvetica, sans-serif;
font-size:16px;
font-weight:bold;
color:#fff;
text-align:left;
 
}
.bannersale{
font-family:Arial, Helvetica, sans-serif;
font-size:16px;
font-weight:bold;
color:#000066;
text-align:left;
}
/*search script*/
p.formLine{
padding: 0 0 0 0;
margin: 5px;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
color:#FFFFFF;
}
label
{
width: 8em;
float: left;
text-align: left;
margin-left: 0em;
display: block;
padding: 5px 0 0 0;
}
.formButton{
color:#223289;
background-color:#FF9D1C;
font-weight:bold;
}
.formSubmit{
padding-left: 5px;
}
#searchtitle{
width: 94px;
height: 30px;
background:url(../images/search_back.gif) no-repeat;
}
.module_quick_search{
background:url(../images/searchline.gif) repeat-x;
width: 200px;
padding-top: 20px;
}
.searchtext{
color:#fff;
font-size: 12px;
font-weight:bold;
padding: 10px 0 0 7px;
font-family:Arial, Helvetica, sans-serif;
}
.formLine hidden{
text-align:left;
}
#footerinfo{
width: 100%;
height: 20px;
color:#FFFFFF;
font-family:Arial, Helvetica, sans-serif;
font-size:10px;
padding-top: 5px;
}
/*main body*/
#maincontent{
width: 100%;
text-align:left;
padding: 10px 5px 0px 5px;
}

Open in new window

0
Comment
Question by:signpost2
[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
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
ram_0218 earned 500 total points
ID: 21858692
in your css,
for element #main  add
position:absolute; left:15%;

and see what it does.
0
 

Author Comment

by:signpost2
ID: 21859330
This does indeed work, however I need it work of the margin: 0 auto somehow in order to get it to look good in all resolutions. I can't understand why it ignores this statement.
0
 
LVL 17

Expert Comment

by:ram_0218
ID: 21859449
your margin statement is being ignored because either the container's layout or the wrapper(in this case the body)'s layout is not *fixed*

add position:absolute; either to body or to your mail and check.
0
 

Author Comment

by:signpost2
ID: 21864051
It just gets ignored and the page doesn't center.
0
 

Author Closing Comment

by:signpost2
ID: 31470145
Can't get this to work, am going to rebuild site again.
0

Featured Post

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
Change of column alignment in div 2 27
Change box shadow 1 34
Put check in your check box 7 16
CSS (jquiry mobile) question 2 2
Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
This is a how to build your own CSS3 slideshow and when I say CSS3 I mean just CSS with no javascript in sight! There a few examples online of how to do this but most just show you an example without any explanation, others make it more complicat…
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…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

749 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