larghezza sito

Postate qui discussioni di carattere generale riguardo a problemi di installazione e configurazione di osCommerce

Moderatore: mod Generali

Rispondi
guardiano
membro Junior
membro Junior
Messaggi: 24
Iscritto il: 17/03/2006, 20:24

larghezza sito

Messaggio da guardiano »

salve,
o provato a modificare il file header.php inserendo all'inizio del codice l'apertura della tabella

<table width="768" border="0" align="center" cellpadding="3" cellspacing="3">
<tr>

dove in width ho inserito la larghezza del sito come suggerito in questo forum.

Purtroppo non ho avuto nessun risultato; infatti in alcune sezioni del sito, column_left.php e column_right.php continuano ad allargarsi fino ai limiti del browser. ho provando anche a chiudere </tr></table> in calce al file footer.php senza risultato.


cosa posso fare?

grazie.
gioborza
membro Regular
membro Regular
Messaggi: 121
Iscritto il: 12/07/2005, 13:02

Messaggio da gioborza »

Hai intrapreso la strada giusta ma non è aprire e chiudere la tabella che ti serve ma potresti utilizzare l'apertura e chiusura di un <DIV> e </DIV>.
Ancora più completo se gli crei una classe nel css e la richiami nel div.

spero di essere stato abbastanza chiaro.........sono sempre di fretta!
Ciao
guardiano
membro Junior
membro Junior
Messaggi: 24
Iscritto il: 17/03/2006, 20:24

Messaggio da guardiano »

gioborza ha scritto:Hai intrapreso la strada giusta ma non è aprire e chiudere la tabella che ti serve ma potresti utilizzare l'apertura e chiusura di un <DIV> e </DIV>.
Ancora più completo se gli crei una classe nel css e la richiami nel div.

spero di essere stato abbastanza chiaro.........sono sempre di fretta!
Ciao
potresti scrivermi un piccolo esempio gentilmente?
gioborza
membro Regular
membro Regular
Messaggi: 121
Iscritto il: 12/07/2005, 13:02

Messaggio da gioborza »

Ecco una soluzione che non mi ricordo neanche più dove l'ho letta...ma comunque va bene:

================================
How to centre your store at a fixed width ?
================================

This tip is to centre your site at a fixed width such as on the free gnome and roundedgreen templates. These are good but in my opinion it is better to have a unique store for your ecommerce site. But thats another story. If you want to learn how to centre YOUR oscommerce store read on and learn exactly how !

The files you will be modifying in this tutorial are:
- includes/header.php
- includes/footer.php
- stylesheet.css

Step 1] First you need to open your header.php file which is found in the includes folder in either notepad or any other text editor. Now go to around line 54 and find where it says "?>" in the code. Make a new line under this (press return) and then enter the following code:

<div id="holder">

So on line 54-56 you should have the code:

?>
<div id="holder"><div id="innerholder">
<table border="0" width="100%" cellspacing="0" cellpadding="0">

If this is the case save your document and close it.

Step 2] Now open your footer.php file (also in the includes folder). Goto the very bottom of the document and insert this piece of code after everything that is already there:

</div>

Then save and close your document.

What you have just done in step 1 and 2 is put the oscommerce site in a "div" or container which we can now specify a width to and centre if we want to.

Step 3] Open your stylesheet.css file and goto the very bottom and add the following code:

#holder{
width: 780px;
margin-left:auto;
margin-right:auto;
}

This tells the "div" or container to be a set width of 780px and to have margins on both side automatically fit so it’s centered on the page.

Then find in the code (normally at the top of the file) where it says:

BODY {
...sometext
}

Leave everything in this as it is however between the two brackets at the bottom change modify it to the following:

BODY {
...sometext
margin: 0;
padding: 0;
border: 0;
text-align: center;
}

Now save and close your stylesheet file.

Step 4] Now upload all your files to your webspace using an FTP client or the built in one in CPanel or whatever control panel software your host uses. Voila you have your new beautifully centred fixed width site !
guardiano
membro Junior
membro Junior
Messaggi: 24
Iscritto il: 17/03/2006, 20:24

Messaggio da guardiano »

gioborza ha scritto:Ecco una soluzione che non mi ricordo neanche più dove l'ho letta...ma comunque va bene:

================================
How to centre your store at a fixed width ?
================================

This tip is to centre your site at a fixed width such as on the free gnome and roundedgreen templates. These are good but in my opinion it is better to have a unique store for your ecommerce site. But thats another story. If you want to learn how to centre YOUR oscommerce store read on and learn exactly how !

The files you will be modifying in this tutorial are:
- includes/header.php
- includes/footer.php
- stylesheet.css

Step 1] First you need to open your header.php file which is found in the includes folder in either notepad or any other text editor. Now go to around line 54 and find where it says "?>" in the code. Make a new line under this (press return) and then enter the following code:

<div id="holder">

So on line 54-56 you should have the code:

?>

!
ma manca qualcosa? non trovo #innerholder
quando la parte centrale si allarga il sito si allarga dalla parte destra mentre dalla parte sinistra rimane in linea con l'header
gioborza ha scritto: <div id="holder"><div id="innerholder">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
gioborza
membro Regular
membro Regular
Messaggi: 121
Iscritto il: 12/07/2005, 13:02

Messaggio da gioborza »

bhe si! effettivamente manca la chiusura ma hai provato ad elimiare l'apertura del div #innerholder, non ricordo precisamente ma forse è un refuso.....e poi è all'interno di #holder per cui se nel css holder è centrato non dovresti avere problemi.
Non è che nella ricerca della modifica, in precedenza hai dato specificato grandezze di qualche altra tabella o oggetto?
guardiano
membro Junior
membro Junior
Messaggi: 24
Iscritto il: 17/03/2006, 20:24

Messaggio da guardiano »

gioborza ha scritto:bhe si! effettivamente manca la chiusura ma hai Non è che nella ricerca della modifica, in precedenza hai dato specificato grandezze di qualche altra tabella o oggetto?
soltanto alla tabella che ho creato in header.php in cui ho inserito le immagini dell'intestazione centrato anch'esso. in index.php invece tutte le tabelle sono al 100%
Bass
membro Master
membro Master
Messaggi: 3593
Iscritto il: 18/04/2004, 0:00
Località: Varese
Contatta:

Re: larghezza sito

Messaggio da Bass »

guardiano ha scritto:salve,
cosa posso fare?
Non e' che nelle pagine che si allargano hai inserito delle immagini troppo grandi?

'iao

Sergio
http://www.oscomtemplate.com - E' disponibile il nuovo pacchetto free con forum di supporto

http://www.semilandia.it
guardiano
membro Junior
membro Junior
Messaggi: 24
Iscritto il: 17/03/2006, 20:24

Re: larghezza sito

Messaggio da guardiano »

Bass ha scritto:
guardiano ha scritto:salve,
cosa posso fare?
Non e' che nelle pagine che si allargano hai inserito delle immagini troppo grandi?

'iao

Sergio
ho parzialmente risolto mettendo l'intestazione dell'header al 100% e usando il codice all'inizio di header.php

<table width="780" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>



ora però succede che le pagine che hanno il corpo centrale più piccolo delle altre si restringono anche le colonne column_left.php e column_right.php

tutto dipende dalla larghezza del corpo centrale
non so che dirvi.

eppure tutte le tabelle sono impostate al 100% di larghezza
Bass
membro Master
membro Master
Messaggi: 3593
Iscritto il: 18/04/2004, 0:00
Località: Varese
Contatta:

Re: larghezza sito

Messaggio da Bass »

guardiano ha scritto: tutto dipende dalla larghezza del corpo centrale
non so che dirvi.
eppure tutte le tabelle sono impostate al 100% di larghezza
E' strano perche' io uso questo sistema senza problemi, le uniche difficolta' sono per le immagini grandi o per delle stringhe senza spazi che spesso allargano tutto...

'iao

Sergio
http://www.oscomtemplate.com - E' disponibile il nuovo pacchetto free con forum di supporto

http://www.semilandia.it
guardiano
membro Junior
membro Junior
Messaggi: 24
Iscritto il: 17/03/2006, 20:24

Messaggio da guardiano »

problema risolto.

praticamente non consideravo i cellpadding="0" e cellspacing="0" nelle tabelle del corpo centrale :)


Ringrazio tutti per l'aiuto.
Rispondi