Simple Machines Community Forum

SMF Support => Language Specific Support => Italiano (Italian) => Topic started by: marcoaureliocommodo on December 28, 2011, 04:47:35 PM

Title: problema con div cat bg
Post by: marcoaureliocommodo on December 28, 2011, 04:47:35 PM
salve ho un problema: io ho cambiato il nome di un tr nel file personal.messages.template.php (il tr si chiamava catbg di default), io l'ho rinominato per poter inserire una mia immagine e per modificarlo con i css, ma appena allego con i css l'immagine che ho fatto, nel forum questa mi si presenta ripetuta qualche volte dall'inizio, poi ho scoperto che solo dei th che vengono dopo nel codice dello stesso file, che impediscono di vedere solo la l'immagine che vorrei
come faccio a togliere lo sfondo ai th?
ho allegato un'immagine

e per cambiare il colore delle scritte data, oggetto ecc??

grazie mille
Title: Re: problema con div cat bg
Post by: emanuele on December 29, 2011, 04:57:49 AM
Beh, dato che mi pare stai cambiando tutte le immagini, forse avresti fatto prima a ricolorare main_bloack.png... ;)

Comunque questo è il css di default di SMF:

tr.catbg th.first_th
{
background: #a7b9cd url(../images/theme/main_block.png) no-repeat 0 -280px;
}
tr.catbg th.last_th
{
background: #a7b9cd url(../images/theme/main_block.png) no-repeat 100% -280px;
}
tr.titlebg th.first_th
{
background: #e3e9ef url(../images/theme/main_block.png) no-repeat 0 -380px;
}
tr.titlebg th.last_th
{
background: #e3e9ef url(../images/theme/main_block.png) no-repeat 100% -380px;
}
.table_grid th.last_th input
{
margin: 0 2px;
}

direi che puoi copiare la stessa struttura usando la tua immagine.
Title: Re: problema con div cat bg
Post by: marcoaureliocommodo on December 29, 2011, 05:11:54 AM
ho tolto tutti gli sfondo ma il risultato resta sempre quello dell'imagine sopra...

se nei css metto a fianco dell'immagine no-repeat, mi saprisce, questo significa che è il php che è sbagliato?
io ho questo codice...
<th align="center" width="4%" class="first_th">
<a href="', $scripturl, '?action=pm;view;f=', $context['folder'], ';start=', $context['start'], ';sort=', $context['sort_by'], ($context['sort_direction'] == 'up' ? '' : ';desc'), ($context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : ''), '"><img src="',$settings['images_url'], '/im_switch.gif" alt="', $txt['pm_change_view'], '" title="', $txt['pm_change_view'], '" width="16" height="16" /></a>
</th>
<th class="lefttext" width="22%">
<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=date', $context['sort_by'] == 'date' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', $txt['date'], $context['sort_by'] == 'date' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>
<th class="lefttext" width="46%">
<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=subject', $context['sort_by'] == 'subject' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', $txt['subject'], $context['sort_by'] == 'subject' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>
<th class="lefttext">
<a href="', $scripturl, '?action=pm;f=', $context['folder'], ';start=', $context['start'], ';sort=name', $context['sort_by'] == 'name' && $context['sort_direction'] == 'up' ? ';desc' : '', $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', '">', ($context['from_or_to'] == 'from' ? $txt['from'] : $txt['to']), $context['sort_by'] == 'name' ? ' <img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a>
</th>
<th align="center" width="4%" class="last_th">
<input type="checkbox" onclick="invertAll(this, this.form);" class="input_check" />
</th>


forse ho capito come devo fare, com'è che si prende con i css una parte di file da un'immagine
(per esempio background: #a7b9cd url(../images/theme/main_block.png) no-repeat 0 -280px;)
0 -280px sarebbe da alto a basso, e da destra a sinistra?

scusate se chiedo qui ma non sono registrato da nessun'altra parte...


Title: Re: problema con div cat bg
Post by: emanuele on December 29, 2011, 05:46:21 AM
Se il problema sono i css, ti suggerirei qualche tutorial (anche perché io stesso non li so usare particolarmente bene), ad esempio: http://www.tizag.com/cssT/background.php

0 e -280px dovrebbero essere l'offset (quindi lo spostamento relativo) dell'immagine in backgroud rispetto alla posizione d'inizio dell'elemento html.
Con altre parole, se nel css backgroud viene specificato 0 -280px, l'immagine verrà "spostata" in alto di 280px in modo che appaia come se iniziasse al 281esimo pixel.
Quindi in questo caso, il "-280" serve a far utilizzare come background la fascia che inizia al 280° pixel di main_block.png.