2016-05-01 9 views
1

Ich möchte nur die Textfarbe eines Eingabeplatzhalters ändern. Ich erstelle diese Seite in der Google Apps for Work-App "Websites". Dies ist der Code eines Tests, den ich verwende. Ich habe versucht wie eine Zillion Kombinationen ohne Erfolg. Heeee!apps script css change placeholder Farbe nach Klasse funktioniert nicht

mein "index" Seite:

<?!= HtmlService.createHtmlOutputFromFile('Styles').getContent(); ?> 
<html> 
    <head> 
    <base target="_top"> 
    </head> 
    <body> 
    <div> 
     <input type="text" class="required" id="yo" placeholder="test me" /> 
    </div> 
    </body> 
</html> 

Meine "Styles" html:

<!-- This CSS package applies Google styling; it should always be included. --> 
<link rel="stylesheet" href="https://ssl.gstatic.com/docs/script/css/add-ons.css"> 

<style> 
<!--Set default style for all placeholder text--> 
input.required:-webkit-input-placeholder { 
    color: #FABBBB; 
} 

input.required:-moz-placeholder { /* Firefox 18- */ 
    color: #FABBBB; 
} 

input.required::-moz-placeholder { /* Firefox 19+ */ 
    color: #FABBBB; 
} 

input.required:-ms-input-placeholder { 
    color: #FABBBB; 
} 

</style> 

Hier ist meine "doGet" Code:

/** 
* Serves HTML of the application for HTTP GET requests. 
* If folderId is provided as a URL parameter, the web app will list 
* the contents of that folder (if permissions allow). Otherwise 
* the web app will list the contents of the root folder. 
* 
* @param {Object} e event parameter that can contain information 
*  about any URL parameters provided. 
*/ 
function doGet(e) { 
    var template = HtmlService.createTemplateFromFile('Index'); 

    // Retrieve and process any URL parameters, as necessary. 
    if (e.parameter.folderId) { 
    template.folderId = e.parameter.folderId; 
    } else { 
    template.folderId = 'root'; 
    } 

    // Build and return HTML in IFRAME sandbox mode. 
    return template.evaluate() 
     .setTitle('Web App Window Title') 
     .setSandboxMode(HtmlService.SandboxMode.IFRAME); 
} 
+0

Wie sieht dein 'doGet' aus? – Adelin

+0

Wenn Sie '' Code verwenden, müssen Sie auch 'createTemplateFromFile()' und dann 'evaluate()' es. Wenn das in Ordnung ist, sollte Sams Lösung funktionieren. – Adelin

Antwort

2

Versuchen:

input.required::-webkit-input-placeholder { 
    color: #FABBBB; 
} 

Hinweis, zwei Doppelpunkte für Webkit. Diese Seite hat sie für die anderen Browser aufgelistet - nicht getestet.

+0

Ich habe die beiden Doppelpunkte hinzugefügt und es hat nicht geholfen. – voman