Центриране .css

vinsbg

Registered
Здравейте,
може ли някой да ми помогне с едно центриране на един .css ?
Малко е дълъг, но ето го:

Код:
body {
	background: #ededed url('images/headerbg.jpg') top center repeat-x;
	font-family:"Segoe","Segoe UI","Humanist 777","Frutiger","Univers","Frobisher",Verdana,Arial,Lucida,times new roman,"Myriad Pro","Myriad";
	font-size:12px;
	color:#FFFFFF;
	margin: 0 0 0 0;
}

.main {
	background: #51b9ee url('images/mainbg.jpg') top center repeat-y;
	width:950px;
}

.container {
	background: #ededed;
	margin-left: auto;
	margin-right: auto;
	width:950px;
	display:table; /* FireFox hack */
	text-align:left;
}

.header {
	background: #c8c8c8 url('images/header.jpg') top center;
	height:180px;
	width:950px;
	margin: 0 auto;
}

.headertitle {
	font-size:52px;
	font-family: Segue UI, Geneva, Vera, Arial, Helvetica, sans-serif;
	font-variant : small-caps;	
	font-weight:bold;
	position:absolute;
	color:#000000;
	top:30px;
	left:190px;
	
}

.adtop {
	text-align:center;
}

.adside {
	position:absolute;
	top:282px;
	left: 781px;
	z-index:1;	
}
.vicove  {
   
     border: 1px solid #ddd;
     background-color : #00000;
     margin: 10px;
     padding: 10px;
     font-size: 15px;
     font-family: tahoma;
}

.rightside {
	float:left;
	margin: 0 0 60px 14px;
	width:565px;
}

.leftside {
	float:left;
	background: #FFFFFF url('images/sidebar_02repeat.jpg') top center;
	margin: 0px 0 -5px 8px;
	width:191px;
}

.leftside h2 {
	font-size:12px;
	text-align:center;
	margin: 0 0 -5px 0;
	background: #FFFFFF url('images/sidebartop.gif') top center;
}

.leftside li {
	list-style-image: url('images/li.gif');
	font-family: verdana,arial,times;
	font-size:12px;

	margin:0 5px 2px -5px;
}

.leftside li a {
	color: #FFFFFF;
	text-decoration: none;
}

.leftside li a:hover {
	color: #DDDDDD;
	text-decoration: none;
	background:#000000;
}

.sidebarback {
	background: url('images/sidebar_01top.jpg') top left no-repeat;
}

.menuholder { width:730px; }

.menu {
	position:relative;
	top:-41px;
	left:70px;
	font-size:12px;
	color:#2f2f2f;
	width:950px;
	text-align:center;
	font-family:Verdana,Arial,Times;
}
	
.menu a{
	color:#FFFFFF;
	text-decoration:none;
}	

.menu a:hover{
	color:#DDDDDD;
}		

.footer {
	clear:both;
	background: #ededed;
	height:107px;
	width:950px;
	margin: 0 auto;
	font-size:80%;
}

.footertext {
	color:#000000;
	padding:0 50px 0 0;
	text-align:right;
}

a img {
	border:none;
}

#blockdiv img {
	max-height: 50px;
	max-width: 50px;
	padding: 0 40px 0px 40px;
	width: expression(this.width > 50 ? 50: true);
	height: expression(this.height > 50 ? 50: true);
	position:relative;
	top:-172px;
	z-index:1;
}

#blockdiv a img {
	max-height: 80px;
	max-width: 101px;
	padding: 0 0 0 0;
	width: expression(this.width > 101 ? 101: true);
	height: expression(this.height > 80 ? 80: true);
	position:relative;
	top:-15px;
	left:33px;
}

#blockdiv {
	height:176px;
	width:135px;
	min-height:176px;
	min-width:135px;
	background: url('images/tableback1.gif') top center;
	float:left;
	display:block;
	margin: 0 2px 0 2px
}

#blockdiv h4 {
	text-align:center;
	font-size:95%;
	position:relative;
	top:0px;
}

.block {
	margin-left:auto;
	margin-right:auto;
	width:560px;
}

.bottomnav {
	margin-left:auto;
	margin-right:auto;
	float:right;
}
.bottomnav a{
	text-decoration:none;
	font-family:verdana,arial;
	font-size:20px;
	color:#000000;
	position:relative;
	top:3px;
}

#blockdiv .spacer {
	padding:0 40px 0 40px;
	margin:0;
	top:0;
}

/* SCRIPT DEPENDANT CSS (NON AMTheme 3) */

.detail {
	background:#5993eb;
	border:1px solid #333333;
	margin:0 0 -65px 0;
	padding: 5px 10px 5px 10px;
	position:relative;
	color:#000000;
}

.playnow a img{
	z-index:0;
	position:relative;
	left:471px;
	top:-3px;
}

.reviews, .article, .register form, .login form, .gameembed {
	background: url('images/bigback_trepeat.jpg') top left repeat-y;
	border-top: 4px solid #3f667b;
	border-bottom: 4px solid #3f667b;
	width:556px;
}

.gameembed {
	margin-bottom:18px;
}

.reviews p, .reviews h2, .reviews h3, .reviews form, .postcat, .article h1, .article h2, .article p, form p, .gameembed h3 {
	padding: 0 20px 0 20px ;
}

.individualreview {
	border: 1px solid #313131;
	background:#FFFFFF;
	padding: 10px 20px 10px 20px ;
	margin: 10px 20px 5px 20px ;
	width:400px;
}

.reviewtext {
	font-size:10px;
	color:#333333;
	text-indent:10px;
	background:#AAAAAA;
}


.addreview {
	width:200px;
	padding:15px 15px 15px 15px;
	border: 1px solid #313131;
	margin: 0 auto 0 auto;
}

h1, h1 a {
	color:#FFFFFF;
	font-size:22px;
	text-decoration:none;
}

h1 a:hover, a:hover {
	color:#ff5400;
}

h2 {
	color:#FFFFFF;
	font-size:18px;
}

a {
	color:#000000;
}

.gamedetails {
	color:#FFFFFF;
	background: url('images/bigback.gif') top left no-repeat;
	padding: 10px 28px 10px 12px;
	height:238px;
	min-height:238px;
}

.gamedetails p{
	margin: 0 0 0 70px;
}
.gamedetails img{
	float:left;
	margin: 5px 5px 5px 5px;
}

.register form, .login form {
	font-size: 14px;
	display:table;
}

.register input, .login input {
	width: 400px;
	height: 22px;
	margin: -20px 0 20px 0;
	font-size: 18px;
	font-family:Verdana,Arial,Times;
	background:#ededed;	
	float:right;
	position:relative;
	left:-20px;
}

.register input:hover, .register input:hover:active, .login input:hover, .login input:hover:active{
	background:#FFFFFF;
}

#regsubmit, #submit, #tafbutton {
	background: #fff;
	padding: 1px;
	font-family: Geneva, Vera, Arial, Helvetica, sans-serif;
	font-size: x-small;
	font-variant : small-caps;
	border : 1px solid #aaa;
	width:30%;
	margin:0 10px 0 0;
}

#regsubmit:hover, #submit:hover, #tafbutton:hover {
	border : 1px solid #000;
}

#agree, #sponsored, #rememb {
	width: 15px;
	background:transparent;
	margin:-10px 0 0 0;	
}

#tafbutton {
clear:both;
}

.tellafriend label {
    display:block;
}

.register textarea, .gameembed textarea {
	width: 492px;
	height: 100px;
	margin: 0 0 20px 0;
	font-size: 11px;
	font-weight: normal;
}

.gameembed textarea {
margin: 0 5px 10px 30px;
}

.welcomebox, .featuredgame, .suggestedgames {
	background: url('images/mediumback.gif') top left no-repeat;
	width:275px;
	height:240px;
	min-width:275px;
	min-height:240px;
	float:left;
}

.welcomebox p, .featuredgame p, .suggestedgames p, .tellafriend p, .tellafriend label {
	padding:10px 10px 10px 10px;
	overflow:hidden;
}

.welcomebox h2, .featuredgame h2, .suggestedgames h3, .tellafriend h3{
	padding:10px 10px 0px 10px;
	text-align:center;
	margin:0 0 0 0;
}

.suggestedgames, .tellafriend {
	margin-top:15px;
}

.tellafriend form {
	margin:-40px 0 0 65px;
}

.tellafriend label {
	display:block;
	margin-bottom:-8px;
}

.featuredgame {
	background: url('images/featuredgame.gif') top left no-repeat;
	margin-left:7px;
}

.featuredgame img {
	float:left;
	padding:10px 10px 10px 10px;
}

.featuredgame a{
	color:#FFFFFF;
	font-size:16px;
	text-decoration:none;
	float:right;
}

.featuredgame a:hover{
	color:#041a00;
}

.tellafriend {
	background: url('images/mediumgreen.jpg') top left no-repeat;
	width:274px;
	height:240px;
	min-width:274px;
	min-height:240px;
	float:right;
	position:relative;
	left:-10px;
}


#searchbox {
	position:absolute;
	top:70px;
	left:842px;
}

.topcategory {
	height:176px;
	width:135px;
	min-height:176px;
	min-width:135px;
	background: url('images/tableback1.gif') top center;
	float:left;
	display:block;
	margin: 4px 6px 0 0px
}

.topcategory h2 a, .topcategory h2 {
	font-size:14px;
	text-align:center;
	color:#ffffff;
	text-decoration:none;
}

.topcategory img {
	margin: 0 auto 0 auto;
}

.topcategory ul, .topcategory a {
	margin:-10px 5px 0 0;
	color:#ffffff;
	line-height:12px;
	text-decoration:none;
	width:120px;
	
}

.topcategory li {
height:13px;
overflow:hidden;
position:relative;
left:-25px;
}

.toplogin {
	position:absolute;
	top:164px;
	left:332px;
	text-align:right;
	width:600px;
	font-variant : small-caps;	
	color:#000000;
}

.toplogin a {
	text-decoration:none;
	color:#000000;	
}
Благодаря предварително +1
 
Пробвай или на .main или на .container (в зависимост от това кое ти е главния) да сложиш едно margin: 0 auto; , а ако нямаш такъв направи един div (главен), сложи всичко в него и му задай margin: 0 auto;
 
Код:
body {
   background: #ededed url('images/headerbg.jpg') top center repeat-x;
   font-family:"Segoe","Segoe UI","Humanist 777","Frutiger","Univers","Frobisher",Verdana,Arial,Lucida,times new roman,"Myriad Pro","Myriad";
   font-size:12px;
   color:#FFFFFF;
margin-left:auto;
margin-right:auto;
}

.main {
   background: #51b9ee url('images/mainbg.jpg') top center repeat-y;
   width:950px;
}

.container {
   background: #ededed;
   margin-left: auto;
   margin-right: auto;
   width:950px;
   display:table; /* FireFox hack */
   text-align:left;
}

.header {
   background: #c8c8c8 url('images/header.jpg') top center;
   height:180px;
   width:950px;
   margin: 0 auto;
}

.headertitle {
   font-size:52px;
   font-family: Segue UI, Geneva, Vera, Arial, Helvetica, sans-serif;
   font-variant : small-caps;   
   font-weight:bold;
   position:absolute;
   color:#000000;
   top:30px;
   left:190px;
   
}

.adtop {
   text-align:center;
}

.adside {
   position:absolute;
   top:282px;
   left: 781px;
   z-index:1;   
}
.vicove  {
   
     border: 1px solid #ddd;
     background-color : #00000;
     margin: 10px;
     padding: 10px;
     font-size: 15px;
     font-family: tahoma;
}

.rightside {
   float:left;
   margin: 0 0 60px 14px;
   width:565px;
}

.leftside {
   float:left;
   background: #FFFFFF url('images/sidebar_02repeat.jpg') top center;
   margin: 0px 0 -5px 8px;
   width:191px;
}

.leftside h2 {
   font-size:12px;
   text-align:center;
   margin: 0 0 -5px 0;
   background: #FFFFFF url('images/sidebartop.gif') top center;
}

.leftside li {
   list-style-image: url('images/li.gif');
   font-family: verdana,arial,times;
   font-size:12px;

   margin:0 5px 2px -5px;
}

.leftside li a {
   color: #FFFFFF;
   text-decoration: none;
}

.leftside li a:hover {
   color: #DDDDDD;
   text-decoration: none;
   background:#000000;
}

.sidebarback {
   background: url('images/sidebar_01top.jpg') top left no-repeat;
}

.menuholder { width:730px; }

.menu {
   position:relative;
   top:-41px;
   left:70px;
   font-size:12px;
   color:#2f2f2f;
   width:950px;
   text-align:center;
   font-family:Verdana,Arial,Times;
}
   
.menu a{
   color:#FFFFFF;
   text-decoration:none;
}   

.menu a:hover{
   color:#DDDDDD;
}      

.footer {
   clear:both;
   background: #ededed;
   height:107px;
   width:950px;
   margin: 0 auto;
   font-size:80%;
}

.footertext {
   color:#000000;
   padding:0 50px 0 0;
   text-align:right;
}

a img {
   border:none;
}

#blockdiv img {
   max-height: 50px;
   max-width: 50px;
   padding: 0 40px 0px 40px;
   width: expression(this.width > 50 ? 50: true);
   height: expression(this.height > 50 ? 50: true);
   position:relative;
   top:-172px;
   z-index:1;
}

#blockdiv a img {
   max-height: 80px;
   max-width: 101px;
   padding: 0 0 0 0;
   width: expression(this.width > 101 ? 101: true);
   height: expression(this.height > 80 ? 80: true);
   position:relative;
   top:-15px;
   left:33px;
}

#blockdiv {
   height:176px;
   width:135px;
   min-height:176px;
   min-width:135px;
   background: url('images/tableback1.gif') top center;
   float:left;
   display:block;
   margin: 0 2px 0 2px
}

#blockdiv h4 {
   text-align:center;
   font-size:95%;
   position:relative;
   top:0px;
}

.block {
   margin-left:auto;
   margin-right:auto;
   width:560px;
}

.bottomnav {
   margin-left:auto;
   margin-right:auto;
   float:right;
}
.bottomnav a{
   text-decoration:none;
   font-family:verdana,arial;
   font-size:20px;
   color:#000000;
   position:relative;
   top:3px;
}

#blockdiv .spacer {
   padding:0 40px 0 40px;
   margin:0;
   top:0;
}

/* SCRIPT DEPENDANT CSS (NON AMTheme 3) */

.detail {
   background:#5993eb;
   border:1px solid #333333;
   margin:0 0 -65px 0;
   padding: 5px 10px 5px 10px;
   position:relative;
   color:#000000;
}

.playnow a img{
   z-index:0;
   position:relative;
   left:471px;
   top:-3px;
}

.reviews, .article, .register form, .login form, .gameembed {
   background: url('images/bigback_trepeat.jpg') top left repeat-y;
   border-top: 4px solid #3f667b;
   border-bottom: 4px solid #3f667b;
   width:556px;
}

.gameembed {
   margin-bottom:18px;
}

.reviews p, .reviews h2, .reviews h3, .reviews form, .postcat, .article h1, .article h2, .article p, form p, .gameembed h3 {
   padding: 0 20px 0 20px ;
}

.individualreview {
   border: 1px solid #313131;
   background:#FFFFFF;
   padding: 10px 20px 10px 20px ;
   margin: 10px 20px 5px 20px ;
   width:400px;
}

.reviewtext {
   font-size:10px;
   color:#333333;
   text-indent:10px;
   background:#AAAAAA;
}


.addreview {
   width:200px;
   padding:15px 15px 15px 15px;
   border: 1px solid #313131;
   margin: 0 auto 0 auto;
}

h1, h1 a {
   color:#FFFFFF;
   font-size:22px;
   text-decoration:none;
}

h1 a:hover, a:hover {
   color:#ff5400;
}

h2 {
   color:#FFFFFF;
   font-size:18px;
}

a {
   color:#000000;
}

.gamedetails {
   color:#FFFFFF;
   background: url('images/bigback.gif') top left no-repeat;
   padding: 10px 28px 10px 12px;
   height:238px;
   min-height:238px;
}

.gamedetails p{
   margin: 0 0 0 70px;
}
.gamedetails img{
   float:left;
   margin: 5px 5px 5px 5px;
}

.register form, .login form {
   font-size: 14px;
   display:table;
}

.register input, .login input {
   width: 400px;
   height: 22px;
   margin: -20px 0 20px 0;
   font-size: 18px;
   font-family:Verdana,Arial,Times;
   background:#ededed;   
   float:right;
   position:relative;
   left:-20px;
}

.register input:hover, .register input:hover:active, .login input:hover, .login input:hover:active{
   background:#FFFFFF;
}

#regsubmit, #submit, #tafbutton {
   background: #fff;
   padding: 1px;
   font-family: Geneva, Vera, Arial, Helvetica, sans-serif;
   font-size: x-small;
   font-variant : small-caps;
   border : 1px solid #aaa;
   width:30%;
   margin:0 10px 0 0;
}

#regsubmit:hover, #submit:hover, #tafbutton:hover {
   border : 1px solid #000;
}

#agree, #sponsored, #rememb {
   width: 15px;
   background:transparent;
   margin:-10px 0 0 0;   
}

#tafbutton {
clear:both;
}

.tellafriend label {
    display:block;
}

.register textarea, .gameembed textarea {
   width: 492px;
   height: 100px;
   margin: 0 0 20px 0;
   font-size: 11px;
   font-weight: normal;
}

.gameembed textarea {
margin: 0 5px 10px 30px;
}

.welcomebox, .featuredgame, .suggestedgames {
   background: url('images/mediumback.gif') top left no-repeat;
   width:275px;
   height:240px;
   min-width:275px;
   min-height:240px;
   float:left;
}

.welcomebox p, .featuredgame p, .suggestedgames p, .tellafriend p, .tellafriend label {
   padding:10px 10px 10px 10px;
   overflow:hidden;
}

.welcomebox h2, .featuredgame h2, .suggestedgames h3, .tellafriend h3{
   padding:10px 10px 0px 10px;
   text-align:center;
   margin:0 0 0 0;
}

.suggestedgames, .tellafriend {
   margin-top:15px;
}

.tellafriend form {
   margin:-40px 0 0 65px;
}

.tellafriend label {
   display:block;
   margin-bottom:-8px;
}

.featuredgame {
   background: url('images/featuredgame.gif') top left no-repeat;
   margin-left:7px;
}

.featuredgame img {
   float:left;
   padding:10px 10px 10px 10px;
}

.featuredgame a{
   color:#FFFFFF;
   font-size:16px;
   text-decoration:none;
   float:right;
}

.featuredgame a:hover{
   color:#041a00;
}

.tellafriend {
   background: url('images/mediumgreen.jpg') top left no-repeat;
   width:274px;
   height:240px;
   min-width:274px;
   min-height:240px;
   float:right;
   position:relative;
   left:-10px;
}


#searchbox {
   position:absolute;
   top:70px;
   left:842px;
}

.topcategory {
   height:176px;
   width:135px;
   min-height:176px;
   min-width:135px;
   background: url('images/tableback1.gif') top center;
   float:left;
   display:block;
   margin: 4px 6px 0 0px
}

.topcategory h2 a, .topcategory h2 {
   font-size:14px;
   text-align:center;
   color:#ffffff;
   text-decoration:none;
}

.topcategory img {
   margin: 0 auto 0 auto;
}

.topcategory ul, .topcategory a {
   margin:-10px 5px 0 0;
   color:#ffffff;
   line-height:12px;
   text-decoration:none;
   width:120px;
   
}

.topcategory li {
height:13px;
overflow:hidden;
position:relative;
left:-25px;
}

.toplogin {
   position:absolute;
   top:164px;
   left:332px;
   text-align:right;
   width:600px;
   font-variant : small-caps;   
   color:#000000;
}

.toplogin a {
   text-decoration:none;
   color:#000000;   
}
 
sinn каза:
Пробвай или на .main или на .container (в зависимост от това кое ти е главния) да сложиш едно margin: 0 auto; , а ако нямаш такъв направи един div (главен), сложи всичко в него и му задай margin: 0 auto;

Мерси по твоя начин стана.Zion нещо не се получи с твоя.+1
 
Да не отварям нова тема...това как мога да го преместя на дясно малко ?

Код:
.headertitle {
   font-size:52px;
   font-family: Segue UI, Geneva, Vera, Arial, Helvetica, sans-serif;
   font-variant : small-caps;   
   font-weight:bold;
   position:absolute;
   color:#000000;
   top:30px;
   left:190px;
   
}
 
vinsbg каза:
Да не отварям нова тема...това как мога да го преместя на дясно малко ?

Код:
.headertitle {
   font-size:52px;
   font-family: Segue UI, Geneva, Vera, Arial, Helvetica, sans-serif;
   font-variant : small-caps;   
   font-weight:bold;
   position:absolute;
   color:#000000;
   top:30px;
   left:190px;
   
}


left:190px; - от тук!
 
shterev каза:
vinsbg каза:
Да не отварям нова тема...това как мога да го преместя на дясно малко ?

Код:
.headertitle {
   font-size:52px;
   font-family: Segue UI, Geneva, Vera, Arial, Helvetica, sans-serif;
   font-variant : small-caps;   
   font-weight:bold;
   position:absolute;
   color:#000000;
   top:30px;
   left:190px;
   
}


left:190px; - от тук!

Мерси.. :?: :?:
 

Back
Горе