Apps Script公式リファレンス: Apps Script Reference |障害・課題追跡: IssueTracker |Google Workspace: Status Dashboard - Summary

2017年12月13日水曜日

placeholderの色を変更する


placeholderの文字色を変更したくて調べた時に書いたコードです




    ::-webkit-input-placeholder {
      color: pink;
    }


<style></style>内に上記の設定を書くと指定した色に変更できるようです(Chrome)


HTML Serviceで実際に試してみた例が以下のコードです



コード.gs
function doGet(){
 return HtmlService.createHtmlOutputFromFile('index'); 
}
意訳
この処理は以下を実行する
指定したHTMLファイルを表示する




index.html
<!DOCTYPE html>
<html>
<head>
  <style>
    ::-webkit-input-placeholder {
      color: pink;
    }
  </style>
</head>
<body>
  <input type="text" placeholder="テキスト入力">
</body>
</html>
意訳
HTMLの宣言
ここからhtml
ここからhead
ここからstyle
placeholderの
文字色をpinkにする

ここまでstyle
ここまでhead
ここまでbosy
テキストボックスを配置する
ここまでbody
ここまでhtml


関連記事

HTMLServiceで試す手順
Google Apps ScriptのWebアプリ雛形

Latest post

Google Apps Scriptの障害時はIssueTrackerを見てみる - Incidents for Apps Script are reported on Issue Tracker

IssueTracker > Apps Script issues https://issuetracker.google.com/savedsearches/566234 Google Apps Scriptの障害時は IssueTracker に課題が上がっていることが...