Style codice css mi serve aiuto
Автор: Olindo B.ringrazio anticipatamente chi aiuta.
Ho delle linee di codice che danno lo stile ad un player audio.
Come posso per non riscrivere tutte le righe applicare il codice ad n player?
qui ho messo un prova con due ma se dovessi averne 100 dovrei ongi volta ripetere il codice:
#amazingaudioplayer-1
#amazingaudioplayer-2
#amazingaudioplayer-3 etc etc
esempio
@import url(http://fonts.googleapis.com/css?family=Open+Sans|Oswald);
#amazingaudioplayer-1 {
box-sizing: content-box;
}
#amazingaudioplayer-1 div {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
#amazingaudioplayer-1 .amazingaudioplayer-image {
}
#amazingaudioplayer-1 .amazingaudioplayer-image-clear {
}
#amazingaudioplayer-1 .amazingaudioplayer-text {
}
#amazingaudioplayer-1 .amazingaudioplayer-text-clear {
}
#amazingaudioplayer-1 .amazingaudioplayer-title {
}
#amazingaudioplayer-1 .amazingaudioplayer-title-clear {
}
#amazingaudioplayer-1 .amazingaudioplayer-info {
}
#amazingaudioplayer-1 .amazingaudioplayer-info-clear {
}
#amazingaudioplayer-1 .amazingaudioplayer-bar {
}
#amazingaudioplayer-1 .amazingaudioplayer-bar-buttons-clear {
}
#amazingaudioplayer-1 .amazingaudioplayer-bar-clear {
}
#amazingaudioplayer-1 .amazingaudioplayer-bar-title {
}
#amazingaudioplayer-1 .amazingaudioplayer-playpause {
}
#amazingaudioplayer-1 .amazingaudioplayer-play {
position: relative;
}
#amazingaudioplayer-1 .amazingaudioplayer-pause {
position: relative;
}
#amazingaudioplayer-1 .amazingaudioplayer-stop {
}
#amazingaudioplayer-1 .amazingaudioplayer-prev {
}
#amazingaudioplayer-1 .amazingaudioplayer-next {
}
#amazingaudioplayer-1 .amazingaudioplayer-loop {
}
#amazingaudioplayer-1 .amazingaudioplayer-progress {
}
#amazingaudioplayer-1 .amazingaudioplayer-progress-loaded {
}
#amazingaudioplayer-1 .amazingaudioplayer-progress-played {
}
#amazingaudioplayer-1 .amazingaudioplayer-time {
}
#amazingaudioplayer-1 .amazingaudioplayer-volume {
}
#amazingaudioplayer-1 .amazingaudioplayer-volume-bar {
}
#amazingaudioplayer-1 .amazingaudioplayer-volume-bar-adjust {
}
#amazingaudioplayer-1 .amazingaudioplayer-volume-bar-adjust-active {
}
#amazingaudioplayer-1 .amazingaudioplayer-tracklist {
}
#amazingaudioplayer-1 .amazingaudioplayer-tracklist-container {
}
#amazingaudioplayer-1 .amazingaudioplayer-tracks-wrapper {
}
#amazingaudioplayer-1 .amazingaudioplayer-tracks {
}
#amazingaudioplayer-1 .amazingaudioplayer-track-item {
}
#amazingaudioplayer-1 .amazingaudioplayer-track-item-active {
}
#amazingaudioplayer-1 .amazingaudioplayer-track-item a {
}
#amazingaudioplayer-1 .amazingaudioplayer-track-item-active a {
}
#amazingaudioplayer-1 .amazingaudioplayer-track-item-duration {
}
#amazingaudioplayer-1 .amazingaudioplayer-tracklist-arrow-prev {
}
#amazingaudioplayer-1 .amazingaudioplayer-tracklist-arrow-next {
}
#amazingaudioplayer-1 .amazingaudioplayer-tracklist-clear {
}
@import url(http://fonts.googleapis.com/css?family=Open+Sans|Oswald);
#amazingaudioplayer-2 {
box-sizing: content-box;
}
#amazingaudioplayer-2 div {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
#amazingaudioplayer-2 .amazingaudioplayer-image {
}
#amazingaudioplayer-2 .amazingaudioplayer-image-clear {
}
#amazingaudioplayer-2 .amazingaudioplayer-text {
}
#amazingaudioplayer-2 .amazingaudioplayer-text-clear {
}
#amazingaudioplayer-2 .amazingaudioplayer-title {
}
#amazingaudioplayer-2 .amazingaudioplayer-title-clear {
}
#amazingaudioplayer-2 .amazingaudioplayer-info {
}
#amazingaudioplayer-2 .amazingaudioplayer-info-clear {
}
#amazingaudioplayer-2 .amazingaudioplayer-bar {
}
#amazingaudioplayer-2 .amazingaudioplayer-bar-buttons-clear {
}
#amazingaudioplayer-2 .amazingaudioplayer-bar-clear {
}
#amazingaudioplayer-2 .amazingaudioplayer-bar-title {
}
#amazingaudioplayer-2 .amazingaudioplayer-playpause {
}
#amazingaudioplayer-2 .amazingaudioplayer-play {
position: relative;
}
#amazingaudioplayer-2 .amazingaudioplayer-pause {
position: relative;
}
#amazingaudioplayer-2 .amazingaudioplayer-stop {
}
#amazingaudioplayer-2 .amazingaudioplayer-prev {
}
#amazingaudioplayer-2 .amazingaudioplayer-next {
}
#amazingaudioplayer-2 .amazingaudioplayer-loop {
}
#amazingaudioplayer-2 .amazingaudioplayer-progress {
}
#amazingaudioplayer-2 .amazingaudioplayer-progress-loaded {
}
#amazingaudioplayer-2 .amazingaudioplayer-progress-played {
}
#amazingaudioplayer-2 .amazingaudioplayer-time {
}
#amazingaudioplayer-2 .amazingaudioplayer-volume {
}
#amazingaudioplayer-2 .amazingaudioplayer-volume-bar {
}
#amazingaudioplayer-2 .amazingaudioplayer-volume-bar-adjust {
}
#amazingaudioplayer-2 .amazingaudioplayer-volume-bar-adjust-active {
}
#amazingaudioplayer-2 .amazingaudioplayer-tracklist {
}
#amazingaudioplayer-2 .amazingaudioplayer-tracklist-container {
}
#amazingaudioplayer-2 .amazingaudioplayer-tracks-wrapper {
}
#amazingaudioplayer-2 .amazingaudioplayer-tracks {
}
#amazingaudioplayer-2 .amazingaudioplayer-track-item {
}
#amazingaudioplayer-2 .amazingaudioplayer-track-item-active {
}
#amazingaudioplayer-2 .amazingaudioplayer-track-item a {
}
#amazingaudioplayer-2 .amazingaudioplayer-track-item-active a {
}
#amazingaudioplayer-2 .amazingaudioplayer-track-item-duration {
}
#amazingaudioplayer-2 .amazingaudioplayer-tracklist-arrow-prev {
}
#amazingaudioplayer-2 .amazingaudioplayer-tracklist-arrow-next {
}
#amazingaudioplayer-2 .amazingaudioplayer-tracklist-clear {
}
se tutti i players vanno gestiti con le medesime caratteristiche di stile, puoi togliere dal selettore l'id dell'elemento ed usare solo le classi; i nomi sono già sufficientemente specifici ed articolati che non rischi di selezionare altro
nelle regole dove invece non hai la classe, però hai una struttura interna simile in tutti i fratelli, puoi usare un selettore di attributo che ricerca un testo dentro o all'inizio dell'id togliendo il numero del player:
#amazingaudioplayer-2 div {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
diventa:
div[id^="amazingaudioplayer-"] div {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
Автор
provo ma ho paura che se non metto il selettore numero non vada
Автор
grazie fabio
Автор
non funziona
non funziona quello che hai fatto tu, non quel che ti ho detto io;
io ho dato per scontato che l'id si riferisse ad un div piuttosto che ad un elemento diverso (tipo <audio>); infatti si tratta di un div; ho appena scaricato/installato/usato il software e controllato! Hai sicuramente sbagliato qualcosa tu; mostra un link della tua pagina.
Автор
http://voicesaudio.com/prova/demo-voci.html
eccola scusa la tardiva risposta
sì...e lo script dove sarebbe?
prova ad inserire questo
<style>
div[id^="amazingaudioplayer-"] {
background-color: yellow !important;
}
</style>
guarda un po' se cambia qualcosa in un solo player o in tutti...
Автор
grazie fabio provo..
Автор
diventano tutti gialli..
quindi come scrivo il codice? scusa la mi ignoranza. grazie
Автор
ho messo questo giusto?
<--player-->
div[id^="amazingaudioplayer-"] {
box-sizing: content-box;
}
div[id^="amazingaudioplayer-"] {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-image {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-image-clear {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-text {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-text-clear {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-title {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-title-clear {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-info {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-info-clear {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-bar {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-bar-buttons-clear {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-bar-clear {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-bar-title {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-playpause {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-play {
position: relative;
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-pause {
position: relative;
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-stop {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-prev {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-next {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-loop {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-progress {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-progress-loaded {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-progress-played {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-time {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-volume {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-volume-bar {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-volume-bar-adjust {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-volume-bar-adjust-active {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-tracklist {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-tracklist-container {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-tracks-wrapper {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-tracks {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-track-item {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-track-item-active {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-track-item a {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-track-item-active a {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-track-item-duration {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-tracklist-arrow-prev {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-tracklist-arrow-next {
}
div[id^="amazingaudioplayer-"] .amazingaudioplayer-tracklist-clear {
}
Автор
mi sembra che funzioni. grazie mille