CSS - Centralizar Web

 
Vista:
Imágen de perfil de kokesoft

Centralizar Web

Publicado por kokesoft (27 intervenciones) el 28/08/2014 17:14:26
Hola a todos los programadores de este foro, he intentado de todo para tratar de centralizar la plantilla de mi pagina web, ya probe como centralizar la cabecera de la pagina y ya he resuelto centralizar la cabecera, pero lo que no he podido centralizar es una plantilla de 1000x1000 pixeles que me sale en la parte izquierda..

Aqui les copio el codigo index donde esta en enlace a la imagen grid_1 que es la que quiero centralizar. he tratado de todo para centralizarla y no he podido. espero que me puedan ayudar...

1
2
3
4
5
6
7
8
9
10
11
<table cellspacing="0" cellpadding="0">
{foreach item=grids from=$rows}
  <tr>
  {foreach item=grid from=$grids}
    <td>
      {if !$smarty.session.magnify}<map name="grid_{$grid->id}">{$grid->map()}</map>{/if}<div style="float: left"{if $smarty.session.magnify} onmouseover="zoom_on(event,{$grid->width|escape},{$grid->height|escape},'{$grid->url()|escape}');" onmousemove="zoom_move(event);" onmouseout="zoom_off();"{/if}><img src="{$grid->url()|escape}" usemap="#grid_{$grid->id}" width="{$grid->width|escape}" height="{$grid->height|escape}" alt="" border="0" /></div><div style="clear: both"></div>
    </td>
  {/foreach}
  </tr>
{/foreach}
</table>


Tambien les copio el codigo style.css

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
body {
  margin: 0 auto;
  background: #DDDDFF;
}
 
body, td, input, select {
  font: normal 12px Arial,Helvetica,sans-serif; margin: 0 auto;
}
 
p, form {
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}
 
h1 {
  font-size: 22px;
}
 
h2 {
  font-size: 16px;
}
 
div.toolbar {
  background: #646464;
  padding: 5px;
  color: #FFFFFF;
  width: 989px;
}
 
 
div#cabeza2 {
  background-color:#c69e29;
  height:20px;
  width: 996px;
}
 
 
div.toolbar a {
  color: #FFFFFF;
}
 
 
#language_selector {
  font-size: 11px;
}
 
div.content {
  padding: 5px;
  color: #333333;
}
div.content a {
  color: #333333;
}
 
div.content a:hover {
  color: red;
}
 
.error, .notice {
  color: red;
}
 
div.error {
  padding: 5px;
  border: 1px solid #666666;
  background: white;
}
 
.boxed {
  padding: 5px;
  border: 1px solid;
  margin-left: 2em;
  margin-right: 2em;
}
 
.indent {
  margin-left: 2em;
}
 
td.label {
  text-align: right;
  white-space: nowrap;
  padding-right: 5px;
  width: 1%;
}
 
table.grid {
  border-collapse: collapse;
}
 
table.grid td, table.grid th {
  padding: 5px 15px 5px 15px;
}
 
table.grid th {
  background: #AAAAFF;
}
 
div.snippet {
  white-space: nowrap;
}
 
div.snippet select {
  font-size: 10px;
  vertical-align: middle;
}
 
div.snippet input {
  vertical-align: middle;
}
 
div.snippet textarea {
  width: 100%;
}
 
input[type="radio"] {
  vertical-align: bottom;
}
 
div.alert {
  margin: 25px;
  text-align: center;
  padding: 10px;
  background: white;
  border: 2px solid red;
  font-size: 12px;
  font-weight: bold;
}
 
div.blog_article {
  border-bottom: 1px dashed #AAAAAA;
}
 
p.blog_article_title {
  font-weight: bold;
  font-size: 16px;
}
 
p.blog_article_date {
  font-style: italic;
  color: #888888;
}
 
div.blog_comment {
  border-bottom: 1px dashed #AAAAAA;
}
 
textarea.code {
  font: normal 12px Arial,Helvetica,sans-serif;
  width: 450px;
  background-color: #eeeeee;
  border-color: #cccccc;
  border-style: inset;
  margin-top: 5px;
}
 
p.blog_comment_date {
  font-style: italic;
  color: #888888;
}
 
.tabberlive .tabbertabhide {
  display: none;
}
 
.tabber {
  display: none;
}
.tabberlive {
  margin-top:1em;
}
 
ul.tabbernav
{
  margin: 0;
  padding: 3px 0;
  border-bottom: 1px solid #AAA;
  /* font: bold 12px Verdana, sans-serif */;
  font-weight: bold;
}
 
ul.tabbernav li
{
  list-style: none;
  margin: 0;
  display: inline;
}
 
ul.tabbernav li a
{
  padding: 3px 0.5em;
  margin-left: 3px;
  border: 1px solid #AAA;
  border-bottom: none;
  background: #DDE;
  text-decoration: none;
}
 
ul.tabbernav li a:link { color: #448; }
ul.tabbernav li a:visited { color: #667; }
 
ul.tabbernav li a:hover
{
  color: #000;
  background: #AAE;
  border-color: #AAA;
}
 
ul.tabbernav li.tabberactive a
{
  background-color: #fff;
  border-bottom: 1px solid #fff;
}
 
ul.tabbernav li.tabberactive a:hover
{
  color: #000;
  background: white;
  border-bottom: 1px solid white;
}
 
.tabberlive .tabbertab {
  padding: 5px;
  border: 1px solid #aaa;
  border-top: 0;
}
 
.tabberlive .tabbertab h2 {
  display: none;
}
.tabberlive .tabbertab h3 {
  display: none;
}
 
.tabberlive#tab2 .tabbertab {
  height: 200px;
  overflow: auto;
}
 
.hidde {
  display: none;
}
 
.popup {
  padding: 5px;
}
 
#WzTtDiV {
  background: #e6ecff;
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

Centralizar Web

Publicado por PatrissTV (1 intervención) el 01/09/2014 15:43:52
Hola yo tuve el mismo problema pero encontre varias soluciones.


Prueba en css poner:

1
2
3
4
5
6
img#tuimagen{
left:0;
right:0;
margin-left:auto;
margin-right:auto;
}


la otra manera seria:

1
2
3
4
img#tuimagen{
left:50%;
margin-left:-la mitad del width de tu imagen (por ejemplo si tu foto es de 100px de ancho pondras 50px);
}
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar