CSS Domanda/Dubbio [CSS]

Stato
Discussione chiusa ad ulteriori risposte.

zRampage

Utente Emerald
19 Agosto 2011
797
105
127
424
Salve ragazzi, volevo chiedere una cosa. Se nel mio sito vado per esempio a creare un Player Mp3, una cosa semplice solo con tasto play, pausa e volume, per personalizzarlo con il CSS posso farlo solo tramite il file principale style.css? ( Se non erro si chiama così, scusate se dovesse essere una domanda stupida)
 
I tasti li puoi personalizzare nel file esterno .css oppure dallo stesso file .html, o dall'head oppure direttamente inline

Inviato da MinghiePhone tramite app ufficiale di Inforge.net
 
  • Mi piace
Reazioni: zRampage
Puoi fare in diversi modi, il più pulito è quello di usare un file css a parte ( per esempio quello che già viene utilizzato ) e dire ai vari elementi che comportamento devono avere. Se il tuo player ha dei campi che metti manualmente nell'HTML puoi semplicemente toglierli così non devi aggiungere codice e perdere tempo.
Se ti serve un aiuto più pratico, puoi postare qui il codice che stai utilizzando in modo tale da poterti aiutare al 100% e poterti consigliere molto meglio
 
  • Mi piace
Reazioni: zRampage
Ti ringrazio, il codice è questo:
Codice:
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit; /**background-color: black; /**BACKGROUND CHE PRENDE TUTTA LA PAGINA**/
  vertical-align: baseline;
  outline: none;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
html { overflow-y: scroll; }
body {
  background: #000000;
  background-image: url("scr.png");
  background-repeat: no-repeat;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #313131;
  font-size: 62.5%;
  line-height: 1;
}

::selection { background: #a4dcec; }
::-moz-selection { background: #a4dcec; }
::-webkit-selection { background: #a4dcec; }

::-webkit-input-placeholder { /* WebKit browsers */
  color: #ccc;
  font-style: italic;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
  color: #ccc;
  font-style: italic;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
  color: #ccc;
  font-style: italic;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
  color: #ccc !important;
  font-style: italic; 
}

br { display: block; line-height: 2.2em; }

article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
ol, ul { list-style: none; }

input, textarea {
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  outline: none;
}

blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
strong { font-weight: bold; }

table { border-collapse: collapse; border-spacing: 0; }
img { border: 0; max-width: 100%; }

#topbar {
  background: #4f4a41;
  padding: 10px 0 10px 0;
  text-align: center;
  height: 36px;
  overflow: hidden;
}
#topbar a {
  color: #fff;
  font-size:1.3em;
  line-height: 1.25em;
  text-decoration: none;
  opacity: 0.5;
  font-weight: bold;
}
#topbar a:hover {
  opacity: 1;
}

/** typography **/
h1 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 2.5em;
  line-height: 1.5em;
  letter-spacing: -0.05em;
  margin-bottom: 20px;
  padding: .1em 0;
  color: #444;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}
h1:before,
h1:after {
  content: "";
  position: relative;
  display: inline-block;
  width: 50%;
  height: 1px;
  vertical-align: middle;
  background: #f0f0f0;
}
h1:before {   
  left: -.5em;
  margin: 0 0 0 -50%;
}
h1:after {   
  left: .5em;
  margin: 0 -50% 0 0;
}
h1 > span {
  display: inline-block;
  vertical-align: middle;
  white-space: normal;
}


h2 {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 2.1em;
  line-height: 1.4em;
  letter-spacing: normal;
  margin-bottom: 20px;
  padding: .1em 0;
  color: #444;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

p {
  display: block;
  font-size: 1.35em;
  line-height: 1.5em;
  margin-bottom: 22px;
}

a { color: #f9b233; text-decoration: none; }
a:hover { text-decoration: underline; }

.center { display: block; text-align: center; }

/** page structure **/
#w {
  display: block;
  width: 750px;
  margin: 0 auto;
  padding-top: 30px;
  padding-bottom: 45px;
}

#content {
  display: block;
  width: 100%;
  background : none /** background: #fff; /** SFONDO DIETRO IL PLAYER **/
  padding: 25px 20px;
  padding-bottom: 35px;
  -webkit-box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;
  -moz-box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;
  box-shadow: rgba(0, 0, 0, 0.1) 0px 1px 2px 0px;
}


/** audio player styles **/
.audio-player, .audio-player div, .audio-player h2, .audio-player a, .audio-player span, .audio-player button {
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
}

div.audio-player {
  position: relative;
  width: 450px;
  height: 70px;
  margin: 0 auto;
  background: #4c4e5a;
  background: -webkit-linear-gradient(top, #000000 0%, #000000 100%); //*SFONDI DEL PLAYER ETC **/
  background: -moz-linear-gradient(top, #000000 0%, #000000 100%);
  background: -o-linear-gradient(top, #000000 0%, #000000 100%);
  background: -ms-linear-gradient(top, #000000 0%, #000000 100%);
  background: linear-gradient(top, #000000 0%, #000000 100%);
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
}
.audio-player h2 {
  position: absolute;
  top: 7px;
  left: 10px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: bold;
  font-size: 16px;
  color: #ececec; /**COLORE TESTO SUL PLAYER **/
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* play/pause control */
.mejs-controls .mejs-button button {
  cursor: pointer;
  display: block;
  position: absolute;
  text-indent: -9999px;
}

.mejs-controls .mejs-play button, .mejs-controls .mejs-pause button {
  width: 34px;
  height: 34px;
  top: 32px;
  left: 7px;
  background: transparent url('playpause.png') 0 0 no-repeat;
}
.mejs-controls .mejs-pause button { background-position: 0 -35px; }


/* mute/unmute control */
.mejs-controls .mejs-mute button, .mejs-controls .mejs-unmute button {
  width: 18px;
  height: 19px;
  top: 9px;
  right: 142px;
  background: transparent url('audio.png') 0 0;
}
.mejs-controls .mejs-unmute button { background-position: 0 -19px; }


/* volume scrubber bar */
.mejs-controls div.mejs-horizontal-volume-slider {
  position: absolute;
  top: 13px;
  right: 15px;
  color: red; /**messoio**/
  cursor: pointer;
  border-right-color: #f9b233 !important; /**messoio**/
  /**background-color : yellow; /**messa io**/
}


.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-total {
  width: 120px;
  height: 11px;
  background: #f9b233; /**COLORE DI SFONDO DIETRO LA BARRA VERDE DEL VOLUME**/
  -webkit-box-shadow: inset 0px 1px 0px rgba(0,0,0,0.3), 0px 1px 0px rgba(255,255,255,0.25); /**COLORI DI CONTORNO ALLA BARRA VOLUME **/
  -moz-box-shadow: inset 0px 1px 0px rgba(0,0,0,0.3), 0px 1px 0px rgba(255,255,255,0.25);
  box-shadow: inset 0px 1px 0px rgba(0,0,0,0.3), 0px 1px 0px rgba(255,255,255,0.25);
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
}

.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-current {
  position: absolute;
  width: 0;
  height: 9px;
  top: 1px;
  left: 1px;
  background: #90d26a;
  background: -webkit-linear-gradient(top, #90d26a 0%, #83bb63 100%);
  background: -moz-linear-gradient(top, #90d26a 0%, #83bb63 100%);
  background: -o-linear-gradient(top, #90d26a 0%, #83bb63 100%);
  background: -ms-linear-gradient(top, #90d26a 0%, #83bb63 100%);
  background: linear-gradient(top, #90d26a 0%, #83bb63 100%);
  -webkit-border-radius: 8px;
  -moz-border-radius: 8px;
  border-radius: 8px;
}


/* time scrubber bar */
.mejs-controls div.mejs-time-rail { width: 380px; }

.mejs-controls .mejs-time-rail span {
  position: absolute;
  display: block;
  width: 380px;
  height: 12px;
  top: 40px;
  left: 55px;
  cursor: pointer;
  -webkit-border-radius: 0px 0px 2px 2px;
  -moz-border-radius: 0px 0px 2px 2px;
  border-radius: 0px 0px 2px 2px;
}

.mejs-controls .mejs-time-rail .mejs-time-total {
  background: #565860;
  width: 380px !important; /* fixes display bug using jQuery 1.8+ */
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
}
.mejs-controls .mejs-time-rail .mejs-time-loaded {
  top: 0;
  left: 0;
  width: 0;
  background: #000000; /**COLORE DELLA BARRA PRINCIPALE DEL PLAYER DOVE SCORRE LA MUSICA **/
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
}
.mejs-controls .mejs-time-rail .mejs-time-current {
  top: 0;
  left: 0;
  width: 0;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px;
  border-radius: 3px;
  background: #90d26a;
  background: -webkit-linear-gradient(top, #f9b233 0%, #f9b233 100%); /**MESCOLAZIONE COLORI DELLA BARRA**/
  background: -moz-linear-gradient(top, #90d26a 0%, #83bb63 100%);
  background: -o-linear-gradient(top, #90d26a 0%, #83bb63 100%);
  background: -ms-linear-gradient(top, #90d26a 0%, #83bb63 100%);
  background: linear-gradient(top, #90d26a 0%, #83bb63 100%);
}

/* metallic sliders */
.mejs-controls .mejs-time-rail .mejs-time-handle {
  position: absolute;
  display: block;
  width: 20px;
  height: 22px;
  top: -6px;
  background: url('handle-lg.png') no-repeat;
}
.mejs-controls .mejs-horizontal-volume-slider .mejs-horizontal-volume-handle {
  position: absolute;
  display: block;
  width: 12px;
  height: 14px;
  top: -1px;
  background: url('handle-sm.png') no-repeat;
}


/* time progress tooltip */
.mejs-controls .mejs-time-rail .mejs-time-float {
  position: absolute;
  display: none;
  width: 33px;
  height: 23px;
  top: -26px;
  margin-left: -17px;
  z-index: 9999;
  background: url('time-box.png');
}

.mejs-controls .mejs-time-rail .mejs-time-float-current {
  width: 33px;
  display: block;
  left: 0;
  top: 4px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 10px;
  font-weight: bold;
  color: #f9b233; /**COLORE DEL TESTO DEL TEMPO**/
  text-align: center;
  z-index: 9999;
}

/** clearfix **/
.clearfix:after { content: "."; display: block; clear: both; visibility: hidden; line-height: 0; height: 0; }
.clearfix { display: inline-block; }

html[xmlns] .clearfix { display: block; }
* html .clearfix { height: 1%; }

C'è un problema, sul sito ho uppato tutte le cartelle, sopra nel code metto il link di dove si trova lo sfondo ed il colore è già settato su nero, il punto è che non cambia lo sfondo, ne carica l'immagine. Se lo apro in locale si però e non riesco a capire perchè.
Poi un'altra cosa non riesco a trovare il colore della barra dell'audio, ho rpovato ad inserire qualcosa , ma cambia solo lo sfondo. Ho provato a cambiare i valori Rgba che ci sono ma niente.
 
background-image: url("scr.png")
l'img la carichi nella stessa cartella del tuo file css?
Sisi nella stessa cartella del mio file css. Questo è preso da locale, quando la uppo sul sito clicco sull'img, prendo il link con tutte le sottocartelle etc e lo incollo semplicemente li, tipo /test/media/immagine.png
 
Salve ragazzi, volevo chiedere una cosa. Se nel mio sito vado per esempio a creare un Player Mp3, una cosa semplice solo con tasto play, pausa e volume, per personalizzarlo con il CSS posso farlo solo tramite il file principale style.css? ( Se non erro si chiama così, scusate se dovesse essere una domanda stupida)
Dipende da come hai le cose impostate. È possibile avere più fogli di stile CSS, e si può fare lo stile nella pagina HTML in sé sia nei tag <style> o in un elemento (esempio: <p style = "color: blue"> testo </ p>).
 
Stato
Discussione chiusa ad ulteriori risposte.