Home › Forum › Problemi Vari con WP › Centrare l'immagine di testata su tutti i dispositivi
-
AutorePost
-
-
24 Marzo 2017 alle 20:54 #31353dario valentinoPartecipante
Salve a tutti,
sto modificando questo tema http://www.navthemes.com/north-east-free-blog-theme/ su mio blog http://www.comunicazionepalermo.com/ con un tema child e vorrei potere centrare l’immagine di testata su qualsiasi dispositivo.
Utilizzando impostando un blocco divisore e mettendo la regola margin: auto riesco a centrarla, ma questo vale solamente se si visualizza il blog in versione desktop; tuttavia, se visualizzo lo stesso da tablet o cellulare l’immagine si posta a sinistra allargando lo spazio di visualizzazione del sito.
Esiste un modo per escludere questa modifica per i dispositivi mobili? Ho già cercato anche nel forum ufficiale di WordPress, ho provato ad impostare le stesse regole presenti nel tema Twenty-Twelve (il precedente che utilizzavo, su cui funzionava) ma non sono riuscito a risolvere.
Grazie in anticipo.
-
26 Marzo 2017 alle 17:58 #121463TittiModeratore
Veramente l’immagine non è per niente centrata di per sé e quindi non lo è nemmeno in versione desktop (avrai visto su un desktop piccolo che casualmente ha la misura “giusta”), anzi su desktop il difetto si nota di più e al contrario sembra più centrata sui dispositivi mobili perché essendo l’immagine più grande dello schermo si adatta per forza (malamente perché si stringe e quindi appare schiacciata), mentre su un desktop relativamente grande come ormai sono tutti la non centratura è molto evidente.
Mettendo un
img.header-image {
width: 100%;
}
l’immagine si centra, ma lଠhai inserito un’immagine a forza dove mi pare il tema (che comunque è tutto responsive) non la preveda quindi chiedi a loro la misura consigliata.
Le regole responsive comunque si fanno con i media-queries (tipo se vuoi che su certe dimensioni l’immagine non si veda), ma questo è il forum di WordPress non è un forum di CSS quindi sei hai altri dubbi rivolgiti ai siti appositi.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.