This domain may be for sale!
プログラミング教育や社員の健康をサポートする「CHO室」の取り組みなど、DeNAのCSRに関する情報を発信するブログ
以前の記事で、ココログのヘッダ部分にメニューを設置した話を書きました。メニュー作成のHTMLを全部JavaScriptで記述し、外部ファイルに追い出してしまうことで、内容が変わっても「ブログへの反映」が必要なくなるというアイディアです。 ただ、このやりかただとJavaScriptが「document.write()」の嵐になってしまいますので、多少エレガントな方法を考えてみました。 # タイトル画像は特に記事に関係あるわけじゃないです(^-^;)。 基礎知識 JavaScriptファイルの中で行末に「\」を書くと、そのあとの改行が抑制され、「次の行もつながってるんだよ」という意味になります。 前回の例ではHTMLを1行書くたびに「document.write()」を使ってましたが、「\」を使うともう少し簡単に書けるみたいです。 具体例 今までの例と改善後の例を見てみます。 (1)今までの例
twitterでid:teramakoさんと@ssmylhさんに教えていただいたので覚書。 2012/2/18 0:45 ブコメで突っ込まれまくっているので全体的に修正。 ヤリたいこと createTextNodeで半角スペース(nbsp)半角スペースを生成して、span要素に挿入したい。 2012/2/18 0:52 修正 混同して書いていましたが、nbspではなく半角スペースです。nbspと半角スペースは別物です。 NBSPと通常のスペースの違いは、NBSPを含む文字列が行末に来て、かつ長すぎて行に収まらない場合、文字列全体(NBSPでつながっている文字列も含めて)が次の行へ移動することにある。これは通常の文字列の折り返しと類似している。たとえば、文字列“ambidextrously”は決して分割されることはなく、“am bi dextrous ly”(すなわち“am bi dextr
DOMを制御してコンテンツを動的に変更 JavaScriptを使って、HTMLにアクセスするには、DOM(Document Object Model)というアプリケーションインターフェース(API)を利用します。HTMLは、図1に示すようにDOMツリーと呼ばれる構造で表現することができます。このツリー構造で構成されてHTMLの各要素に、JavaScriptでアクセス可能になっています。 」にJavaScriptでアクセスするためには、リスト2の(1)に記載しているように「document.getElementById("articleTitle")」という方法で記述します。つまり、「document.getElementById("ID名")」という書式でアクセス可能になります。 リスト2の(1)では、これから内容を変更しようとしているHTM内の場所「articleTitle」「conte
前 次 目次 特性 索引 標準情報(TR) TR X 0032:2000 CSS2 目 次 まえがき 序文 1 概要 1.0 適用範囲 1.1 規定の読み方 1.2 規定の構成 1.3 規約 1.3.1 文書言語の要素及び属性 1.3.2 CSS特性定義 値 初期値 適用対象 継承 パーセント値 メディアグループ 1.3.3 簡略記述特性 1.3.4 備考及び例 1.3.5 画像及び長記述 1.4 貢献者 1.5 著作権表示 2 CSS2への導入 2.1 HTMLのためのCSS2概説 2.2 XMLのためのCSS2概説 2.3 CSS2処理モデル 2.3.1 描画面 2.3.2 CSS2アドレス付けモデル 2.4 CSS設計原則 3 適合性(要件及び勧告) 3.1 定義 3.2 適合性 3.3 エラー条件 3.4 text/css内容型 4 CSS2の構文及び基本データ型 4.1 構文
CSS メディアクエリー 画面サイズなど、媒体の持つ特徴を利用し、スタイルシートを適用するための仕組みを提供します。 原文: “Media Queries” (W3C Recommendation 19 June 2012) セレクタ Level 3 :nth-child()や:not()など、新しいセレクタを定義するモジュールです。 原文: “Selectors Level 3” (W3C Recommendation 29 September 2011) CSS 名前空間モジュール CSSで名前空間を扱う@namespace規則を定義しています。 原文: “CSS Namespaces Module” (W3C Recommendation 29 September 2011) CSS カラーモジュール Level 3 opacityやrgba()など、色に関する値やプロパティを定義す
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く