<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>乱雑モックアップ &#187; CSS3</title>
	<atom:link href="http://blog.sakurachiro.com/category/web/css3/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sakurachiro.com</link>
	<description>らんざつ[乱雑] （名・形動）[文]ナリ 入り乱れていること。乱れていて秩序がないこと。また、そのさま。</description>
	<lastBuildDate>Fri, 02 Dec 2011 20:09:59 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/category/web/css3/feed/" />
		<item>
		<title>ie-css3.jsのベータが取れて名前がSelectivizr(:select[ivizr]？)に変わってた</title>
		<link>http://blog.sakurachiro.com/2010/09/selectivizr/</link>
		<comments>http://blog.sakurachiro.com/2010/09/selectivizr/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 09:25:42 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/?p=2127</guid>
		<description><![CDATA[IE8以下にcss3の擬似クラスを対応させるjsのバージョンが1.0になって名前と配布サイトが変わってた。 Selectivizr &#8211; CSS3 pseudo-class and attribute sele [...]]]></description>
			<content:encoded><![CDATA[<p>IE8以下にcss3の擬似クラスを対応させるjsのバージョンが1.0になって名前と配布サイトが変わってた。<br />
<a href="http://selectivizr.com/">Selectivizr &#8211; CSS3 pseudo-class and attribute selectors for IE 6-8</a></p>
<p><a href="http://blog.sakurachiro.com/wp-content/uploads/2010/09/20100923-1.png" rel="shadowbox[sbpost-2127];player=img;" title="Selectivizr - CSS3 pseudo-class and attribute selectors for IE 6-8"><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/09/20100923-1-480x312.png" alt="Selectivizrのwebサイト" title="Selectivizr - CSS3 pseudo-class and attribute selectors for IE 6-8" width="480" height="312" class="alignnone size-large wp-image-2128" /></a></p>
<p>いつのまにか擬似否定クラス E:not(s) にも対応してた(0.9.7bから？)</p>
<p><span id="more-2127"></span></p>
<h3>使い方メモ</h3>
<p>ie-css3.jsと変わらない(おそらく)</p>
<p>上記サイトからelectivizr.jsとお好きなjsライブラリをダウンロードしてくる<br />
<a href="http://javascript.nwbox.com/NWMatcher/">NWMatcher &#8211; CSS3 Selector and Matcher</a>にあるNWMatcher 1.2.2.jsを使うと全開でいけるみたい。</p>
<p><span class="note2">ヘッダ部分の例</span></p>
<pre class="brush: xml; class-name: html-sh; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; src=&quot;js/nwmatcher.js&quot;&gt;&lt;/script&gt;
&lt;!--[if lte IE 8]&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/selectivizr.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt; </pre>
<p><span class="note2">気をつける事</span><br />
やっぱり、ローカルじゃ機能しない。<br />
head無いに書いたcssやインラインのcssの指定は効かない。</p>
<p>そこらへんは前回試した0.9.5bと同じですた。<br />
<a href="http://blog.sakurachiro.com/2010/04/ie-css3-js/">ie-css3.js ( :nth-childなどのCSS3擬似クラスをIEでも使えるようにするjs ) で失敗した事。 | 乱雑モックアップ</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2010/09/selectivizr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2010/09/selectivizr/" />
	</item>
		<item>
		<title>css3のanimationとtransitionとtransform</title>
		<link>http://blog.sakurachiro.com/2010/08/css3-animation-transition-transform/</link>
		<comments>http://blog.sakurachiro.com/2010/08/css3-animation-transition-transform/#comments</comments>
		<pubDate>Sun, 15 Aug 2010 12:59:15 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[とりあえずメモ]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/?p=2054</guid>
		<description><![CDATA[animationとtransitionがcss3のアニメーション用プロパティで transformは変形用のプロパティ、2Dと3Dは別なのか?一緒なのか? とりあえずこの3つが頭の中でホットケーキになっちゃうくらいこん [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.w3.org/TR/css3-animations/">animation</a>と<a href="http://www.w3.org/TR/css3-transitions/">transition</a>がcss3のアニメーション用プロパティで<br />
<a href="http://www.w3.org/TR/css3-2d-transforms/">transform</a>は変形用のプロパティ、<a href="http://www.w3.org/TR/css3-2d-transforms/">2D</a>と<a href="http://www.w3.org/TR/css3-3d-transforms/">3D</a>は別なのか?一緒なのか?<br />
とりあえずこの3つが頭の中でホットケーキになっちゃうくらいこんがらがっちゃってるので練習。<br />
tで始まるのが多すぎるんだ。</p>
<p><span id="more-2054"></span></p>
<h3>animations</h3>
<h4>animationプロパティの特徴とか感じた事とか</h4>
<ul>
<li>ループ出来る。</li>
<li>keyframesを使って細かい設定が出来る。</li>
<li>hoverで動かすとマウスが外れた時すぐに初期状態に戻るのが格好悪い。</li>
<li>なのでループでずっと動かしているか、javascriptと絡めたりした方がいいのかな？と思ったり</li>
</ul>
<h4>animation使用例</h4>
<p><em>webkit系のブラウザのみ動作します。</em></p>
<div class="ani1 example">
<ul>
<li class="ease">ease</li>
<li class="linear">linear</li>
<li class="ease-in">ease-in</li>
<li class="ease-out">ease-out</li>
<li class="ease-in-out">ease-in-out</li>
</ul></div>
<p>ほら、マウスが外れた瞬間ガチっと初期位置にもどるのが格好悪いでしょう？</p>
<p><span class="note2">html</span></p>
<pre class="brush: xml; title: ; notranslate">
  &lt;div class=&quot;ani1 example&quot;&gt;
    &lt;ul&gt;
      &lt;li class=&quot;ease&quot;&gt;ease&lt;/li&gt;
      &lt;li class=&quot;linear&quot;&gt;linear&lt;/li&gt;
      &lt;li class=&quot;ease-in&quot;&gt;ease-in&lt;/li&gt;
      &lt;li class=&quot;ease-out&quot;&gt;ease-out&lt;/li&gt;
      &lt;li class=&quot;ease-in-out&quot;&gt;ease-in-out&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;</pre>
<p>  <span class="note4">css</span></p>
<pre class="brush: css; title: ; notranslate">/*キーフレームはアニメーションの設計図みたいなものだと思ってます*/
@-webkit-keyframes 'ani1' {
0% {
-webkit-transform: translate(0, 0);
}
25% {
-webkit-transform: translate(75%, 100%);
}
50% {
-webkit-transform: translate(50%, 50%);
}
75% {
-webkit-transform: translate(25%, 100%);
}
100% {
-webkit-transform: translate(100%, 0%);
}
}

.ani1:hover li {
  -webkit-animation-name: 'ani1'; /*キーフレームを指定*/
  -webkit-animation-duration: 1s; /*処理にかかる時間、単位はs、これは1秒*/
  -webkit-animation-direction:alternate; /*偶数回時に逆再生させる*/
  -webkit-animation-iteration-count: infinite; /*ループ回数の指定、これは無限*/
}

/*animationのイージング*/
.ani1 li.ease {
  -webkit-animation-timing-function: ease;/*イージングの種類*/
}
.ani1 li.linear {
  -webkit-animation-timing-function: linear;/*イージングの種類*/
}
.ani1 li.ease-in {
  -webkit-animation-timing-function: ease-in;/*イージングの種類*/
}
.ani1 li.ease-out {
  -webkit-animationn-timing-function: ease-out;/*イージングの種類*/
}
.ani1 li.ease-in-out {
  -webkit-animation-timing-function: ease-in-out;/*イージングの種類*/
}
</pre>
<p><em>animation-timing-function</em>はkeyframesの中でも指定できたり色んなところに記述できる？</p>
<h4>ショートハンドを使ってみる</h4>
<p><a href="http://www.w3.org/TR/css3-animations/#the-animation-shorthand-property-">CSS Animations Module Level 3</a>を参照すると以下の記述でショートハンドになるそうな。</p>
<blockquote cite="http://www.w3.org/TR/css3-animations/#the-animation-shorthand-property-">
<p>[&lt;animation-name&gt; || &lt;animation-duration> || &lt;animation-timing-function> || &lt;animation-delay> || &lt;animation-iteration-count> || &lt;animation-direction>] [, [&lt;animation-name> || &lt;animation-duration> || &lt;animation-timing-function> || &lt;animation-delay> || &lt;animation-iteration-count> || &lt;animation-direction>] ]*</p></blockquote>
<p>読み方(w3cが解説に使う記号の意味)がイマイチわかってないけど、.ani1:hover liの指定をショートハンドで書き直すとこんな感じ？<br />
[]内の値が順番関係なしで重複しなければok？<br />
でもそしたらdurationとdelayの区別はどうやってつけてるんだ？先に登場するほうがdurationなのかな。</p>
<pre class="brush: css; title: ; notranslate">
.ani1:hover li {
-webkit-animation:'ani1' 1s infinite alternate;
}
</pre>
<h4>動作確認</h4>
<div class="ani2 example">
<ul>
<li class="ease">ease</li>
<li class="linear">linear</li>
<li class="ease-in">ease-in</li>
<li class="ease-out">ease-out</li>
<li class="ease-in-out">ease-in-out</li>
</ul></div>
<h3>transitions</h3>
<p><strong>transitionプロパティの特徴とか感じた事とか</strong></p>
<ul>
<li>ループさせられない。</li>
<li>変更前と変更後の2つをいったり来たりするので手軽に動きのあるロールオーバーメニューが作れる</li>
<li>これ好きだな。</li>
</ul>
<h4>transition使用例</h4>
<div class="tra1 example">
<ul>
<li class="ease">ease</li>
<li class="linear">linear</li>
<li class="ease-in">ease-in</li>
<li class="ease-out">ease-out</li>
<li class="ease-in-out">ease-in-out</li>
</ul></div>
<p>  <span class="note2">html</span></p>
<pre class="brush: xml; title: ; notranslate">  &lt;div class=&quot;tra1 example&quot;&gt;
    &lt;ul&gt;
      &lt;li class=&quot;ease&quot;&gt;ease&lt;/li&gt;
      &lt;li class=&quot;linear&quot;&gt;linear&lt;/li&gt;
      &lt;li class=&quot;ease-in&quot;&gt;ease-in&lt;/li&gt;
      &lt;li class=&quot;ease-out&quot;&gt;ease-out&lt;/li&gt;
      &lt;li class=&quot;ease-in-out&quot;&gt;ease-in-out&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/div&gt;</pre>
<p>  <span class="note4">css</span></p>
<pre class="brush: css; title: ; notranslate">.tra1 li {
  -webkit-transition-duration: 1s;
}
.tra1:hover li {
  -webkit-transform: translate(100%, 0);
}

/*transitionのイージング*/
.tra1 li.ease {
  -webkit-transition-timing-function: ease;
}
.tra1 li.linear {
  -webkit-transition-timing-function: linear;
}
.tra1 li.ease-in {
  -webkit-transition-timing-function: ease-in;
}
.tra1 li.ease-out {
  -webkit-transition-timing-function: ease-out;
}
.tra1 li.ease-in-out {
  -webkit-transition-timing-function: ease-in-out;
}</pre>
<h4>ショートハンド</h4>
<p>animationsと同じでtransitionsのページを参考に<br />
<a href="http://www.w3.org/TR/css3-transitions/#the-transition-shorthand-property-">CSS Transitions Module Level 3</a></p>
<blockquote cite="http://www.w3.org/TR/css3-transitions/#the-transition-shorthand-property-"><p>&lt;p&gt;[&lt;‘transition-property’&gt; || &lt;‘transition-duration’&gt; || &lt;‘transition-timing-function’&gt; || &lt;‘transition-delay’&gt; [, [&lt;‘transition-property’&gt; || &lt;‘transition-duration’&gt; || &lt;‘transition-timing-function’&gt; || &lt;‘transition-delay’&gt;]]*&lt;/p&gt;</p></blockquote>
<p>この例だと特に使う必要がないけどこんな感じ？</p>
<pre class="brush: css; title: ; notranslate">
.tra1 li {
  -webkit-transition: 1s;
}
.tra1:hover li {
  -webkit-transform: translate(100%, 0);
}
/*transitionのイージング*/
.tra1 .ease {
  -webkit-transition-timing-function: ease;
}
.tra1 .linear {
  -webkit-transition-timing-function: linear;
}
.tra1 .ease-in {
  -webkit-transition-timing-function: ease-in;
}
.tra1 .ease-out {
  -webkit-transition-timing-function: ease-out;
}
.tra1 .ease-in-out {
  -webkit-transition-timing-function: ease-in-out;
}
</pre>
<p>durationがないと上手く動かないな。</p>
<p>もしくはこんな感じ？</p>
<pre class="brush: css; title: ; notranslate">.tra1:hover li {
  -webkit-transform: translate(100%, 0);
}
/*transitionのイージング*/
.tra1 li.ease {
  -webkit-transition:1s ease;
}
.tra1 li.linear {
  -webkit-transition:1s linear;
}
.tra1 li.ease-in {
  -webkit-transition:1s ease-in;
}
.tra1 li.ease-out {
  -webkit-transition:1s ease-out;
}
.tra1 li.ease-in-out {
  -webkit-transition:1s ease-in-out;
}
</pre>
<p>もう少しシンプルな書き方が出来そうだけどなぁ。</p>
<h3>transform</h3>
<p>animationのkeyframesやtransitionの中で出てきたtransformは要素を変形させるプロパティでFirefoxも3.1から対応してるんですって(-moz-が必要)<br />
参考 / <a href="http://gihyo.jp/design/feature/01/css3-approach/0003">CSS3大接近：第3回　transformプロパティ｜gihyo.jp</a><br />
skew(ゆがみ)とかscale(拡大)とかrotate(回転)とかあってtransalteは移動。</p>
<pre class="brush: css; title: ; notranslate">translate(x座標, y座標)</pre>
<blockquote><table border="1" cellspacing="0">
<tr>
<th>機能</th>
<td>移動</td>
</tr>
<tr>
<th>初期値</th>
<td>0</td>
</tr>
<tr>
<th>値</th>
<td>ポジティブ，ネガティブどちらも可<br />
・％<br />
・相対値(emなど)，絶対値（pxなど）</td>
</tr>
<tr>
<th>適用できる要素</th>
<td>・ブロックレベル要素<br />
・インラインレベル要素</td>
</tr>
<tr>
<th>継承</th>
<td>なし（親要素に指定しても子要素に継承されません）</td>
</tr>
<tr>
<th>記述例</th>
<td>Firefox3.1betaの場合：<br />
・-moz-transoform:translate(xxdeg);<br />
・-moz-transoform:translateX(xxdeg);<br />
・-moz-transoform:translateY(xxdeg);<br />
Webkit系（Safari3.1，Webkit,Google chromeの場合：<br />
・-webkit-transform:translate(xxdeg);<br />
・-webkit-transoform:translateX(xxdeg);<br />
・-webkit-transoform:translateY(xxdeg);</td>
</tr>
</table>
</blockquote>
<h3>参考</h3>
<p><a href="http://www.w3.org/TR/css3-animations/">CSS Animations Module Level 3</a><br />
<a href="http://www.w3.org/TR/css3-transitions/">CSS Transitions Module Level 3</a></p>
<p><a href="http://www.w3.org/TR/css3-2d-transforms/">CSS 2D Transforms Module Level 3</a><br />
<a href="http://www.w3.org/TR/css3-3d-transforms/">CSS 3D Transforms Module Level 3</a></p>
<p>しかし毎日暑いですねぇ…</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2010/08/css3-animation-transition-transform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2010/08/css3-animation-transition-transform/" />
	</item>
		<item>
		<title>自動改行(word-break・word-wrap・white-space プロパティ)をコントロールして、テキストがボックスから飛び出さないようにしたい。</title>
		<link>http://blog.sakurachiro.com/2010/06/control-break/</link>
		<comments>http://blog.sakurachiro.com/2010/06/control-break/#comments</comments>
		<pubDate>Mon, 31 May 2010 15:50:33 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/?p=1788</guid>
		<description><![CDATA[ん～、違いがようわからん。 word-break:break-all; word-wrap:break-word; white-space:pre-wrap; 上記3プロパティの動作確認用ページ (ポップアップで開く)  [...]]]></description>
			<content:encoded><![CDATA[<p>ん～、違いがようわからん。</p>
<ul>
<li><a href="http://www.w3.org/TR/css3-text/#word-break">word-break:break-all;</a></li>
<li><a href="http://www.w3.org/TR/css3-text/#word-wrap">word-wrap:break-word;</a></li>
<li><a href="http://www.w3.org/TR/css3-text/#white-space">white-space:pre-wrap;</a></li>
</ul>
<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/06/20100601-1.png" alt="テキストがボックスからはみ出る" title="テキストがボックスからはみ出る" width="480" height="297" class="alignnone size-full wp-image-1789" /></p>
<p><a href="http://sakurachiro.com/_exercise/html_css/css3-text/index.html">上記3プロパティの動作確認用ページ</a> (<a href="http://sakurachiro.com/_exercise/html_css/css3-text/index.html" rel="shadowbox">ポップアップで開く</a>)<br />
Firefoxはどれを指定しても、連続した半角英数が長いとtableが伸びちゃうなぁ。</p>
<p>以下、自分の解釈メモ ( なので正しいかどうか怪しいです )。</p>
<p><span id="more-1788"></span></p>
<h3>word-break</h3>
<p>禁則処理の設定?<br />
<em>break-all</em>にすると日本語の文章中どこでも折り返して、アルファベットもどこでも折り返す。<br />
<span class="note2">選べる値</span></p>
<ul>
<li>normal</li>
<li>keep-all</li>
<li>loose</li>
<li>break-strict</li>
<li>break-all</li>
</ul>
<h3>word-wrap</h3>
<p>英単語の折り返し、<em>break-word</em>で英単語中でも折り返す。<br />
日本語は関係ない?<br />
<span class="note2">選べる値</span></p>
<ul>
<li>normal</li>
<li>break-word</li>
</ul>
<h3>white-space</h3>
<p>半角スペース、タブ、改行の処理<br />
<em>pre-wrap</em>だと、基本動作はpre(半角スペース、タブ、改行はそのまま生かされる)でボックスの幅で改行する。<br />
<span class="note2">選べる値</span></p>
<ul>
<li>normal</li>
<li>pre</li>
<li>nowrap</li>
<li>pre-wrap</li>
<li>pre-line</li>
</ul>
<h3>ブロックレベル要素を勝手に拡張したり、ハミ出したりしないかチェック</h3>
<p>*色の意味</p>
<ul>
<li><span class="ok">自動で折り返す指定</span></li>
<li><span class="ok2">二つ同時に指定すると折り返す</span></li>
<li><span class="ng">勝手に拡張したりハミ出したり</span></li>
</ul>
<table class="conpare">
<caption class="prearea">&lt;pre&gt;</caption>
<tr>
<th>&nbsp;</th>
<th>word-break : break-all ;</th>
<th>word-wrap : break-word ;</th>
<th>white-space : pre-wrap ; </th>
</tr>
<tr>
<th>firefox   3.6.3</th>
<td class="ng">×アドレス<br />
      ×日本語<br />
      ×アルファベット</td>
<td class="ok2">×アドレス<br />
      ×日本語<br />
      ×アルファベット</td>
<td class="ok2">×アルファベット</td>
</tr>
<tr>
<th>chrome 5.0.375</th>
<td class="ng">×アドレス<br />
      ×日本語<br />
      ×アルファベット</td>
<td class="ok">ok</td>
<td class="ng">×アルファベット</td>
</tr>
<tr>
<th>safari 4.0.5</th>
<td class="ng">×アドレス<br />
      ×日本語<br />
      ×アルファベット</td>
<td class="ok">ok</td>
<td class="ng">×アルファベット</td>
</tr>
<tr>
<th>opera 10.53</th>
<td class="ng">×日本語<br />
      ×アルファベット</td>
<td class="ok">ok</td>
<td class="ng">×アルファベット</td>
</tr>
<tr>
<th>IE6</th>
<td class="ng">×日本語<br />
      ×アルファベット</td>
<td class="ok">ok</td>
<td class="ng">×日本語<br />
      ×アルファベット</td>
</tr>
<tr>
<th>IE7</th>
<td class="ng">×日本語<br />
      ×アルファベット</td>
<td class="ok">ok</td>
<td class="ng">×日本語<br />
      ×アルファベット</td>
</tr>
<tr>
<th>IE8</th>
<td class="ng">×日本語<br />
      ×アルファベット</td>
<td class="ok">ok</td>
<td class="ng">×アルファベット</td>
</tr>
</table>
<table class="conpare">
<caption class="divarea">&lt;div&gt;</caption>
<tr>
<th>&nbsp;</th>
<th>word-break : break-all ;</th>
<th>word-wrap : break-word ;</th>
<th>white-space : pre-wrap ; </th>
</tr>
<tr>
<th>firefox   3.6.3</th>
<td class="ng">×アルファベット</td>
<td class="ok">ok</td>
<td class="ng">preになる<br />
      ×アルファベット</td>
</tr>
<tr>
<th>chrome 5.0.375</th>
<td class="ok">ok</td>
<td class="ok">ok</td>
<td class="ng">preになる<br />
      ×アルファベット</td>
</tr>
<tr>
<th>safari 4.0.5</th>
<td class="ok">ok</td>
<td class="ok">ok</td>
<td class="ng">preになる<br />
      ×アルファベット</td>
</tr>
<tr>
<th>opera 10.53</th>
<td class="ng">×アルファベット</td>
<td class="ok">ok</td>
<td class="ng">preになる<br />
      ×アルファベット</td>
</tr>
<tr>
<th>IE6</th>
<td class="ok">ok</td>
<td class="ok">ok</td>
<td class="ng">アルファベット分伸びるけど他はwidthの位置で折り返してる</td>
</tr>
<tr>
<th>IE7</th>
<td class="ok">ok</td>
<td class="ok">ok</td>
<td class="ng">×アルファベット</td>
</tr>
<tr>
<th>IE8</th>
<td class="ok">ok</td>
<td class="ok">ok</td>
<td class="ng">preになる<br />
      ×アルファベット</td>
</tr>
</table>
<table class="conpare">
<caption class="tablearea">&lt;table&gt;</caption>
<tr>
<th>&nbsp;</th>
<th>word-break : break-all ;</th>
<th>word-wrap : break-word ;</th>
<th>white-space : pre-wrap ; </th>
</tr>
<tr>
<th>firefox   3.6.3</th>
<td class="ng">アルファベットに合わせて伸びる</td>
<td class="ng">アルファベットに合わせて伸びる</td>
<td class="ng">アルファベットに合わせて伸びる</td>
</tr>
<tr>
<th>chrome 5.0.375</th>
<td class="ok">ok</td>
<td class="ng">アルファベットに合わせて伸びる</td>
<td class="ng">アルファベットに合わせて伸びる</td>
</tr>
<tr>
<th>safari 4.0.5</th>
<td class="ok">ok</td>
<td class="ng">アルファベットに合わせて伸びる</td>
<td class="ng">アルファベットに合わせて伸びる</td>
</tr>
<tr>
<th>opera 10.53</th>
<td class="ng">アルファベットに合わせて伸びる</td>
<td class="ok">ok</td>
<td class="ng">アルファベットに合わせて伸びる</td>
</tr>
<tr>
<th>IE6</th>
<td class="ok">ok</td>
<td class="ng">アルファベットに合わせて伸びる</td>
<td class="ng">アルファベットに合わせて伸びる</td>
</tr>
<tr>
<th>IE7</th>
<td class="ok">ok</td>
<td class="ng">アルファベットに合わせて伸びる</td>
<td class="ng">アルファベットに合わせて伸びる</td>
</tr>
<tr>
<th>IE8</th>
<td class="ok">ok</td>
<td class="ng">アルファベットに合わせて伸びる</td>
<td class="ng">アルファベットに合わせて伸びる</td>
</tr>
</table>
<h3>崩さないようにする指定は</h3>
<p>今のところtableはcssだけじゃ無理っぽい(Firefoxが)。<br />
preには word-wrap: break-word; と white-space: pre-wrap; (二つ指定しないとFirefoxでハミ出す)<br />
divにも指定するとしたら word-wrap: break-word; のみがいいのかな?</p>
<pre class="brush: css; title: ; notranslate">
pre{
  word-wrap: break-word;
  white-space: pre-wrap;
}
div{
  word-wrap: break-word;
}</pre>
<p>もし、はみ出しちゃった時の為にoverflowを追加しておいてもいいみたい。<br />
優しい人がいるもんだ。</p>
<pre class="brush: css; title: ; notranslate">overflow:auto;</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2010/06/control-break/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2010/06/control-break/" />
	</item>
		<item>
		<title>css3の:nth-last-child(n)や:nth-last-of-type(n)で均等配置</title>
		<link>http://blog.sakurachiro.com/2010/04/css3-nth-last/</link>
		<comments>http://blog.sakurachiro.com/2010/04/css3-nth-last/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 14:55:27 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>
		<category><![CDATA[さくらちろ]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/?p=1642</guid>
		<description><![CDATA[ひとつ前の記事中に使った画像のサイズを勘違いして作成してしまい、テーマによっては段落ちが発生してた。 それがどんな勘違いだったかというとそりゃもう酷い話で、 まず、本文のwidthが480pxの所へ画像を2枚横並びで入れ [...]]]></description>
			<content:encoded><![CDATA[<p>ひとつ前の記事中に使った画像のサイズを勘違いして作成してしまい、テーマによっては段落ちが発生してた。</p>
<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100430-1.png" alt="並んでたり並んでなかったり。" title="並んでたり並んでなかったり。" width="480" height="296" class="alignnone size-full wp-image-1643" /><br />
それがどんな勘違いだったかというとそりゃもう酷い話で、<br />
まず、本文のwidthが480pxの所へ画像を2枚横並びで入れようとした。<br />
その時画像のmarginを10pxとして考えて、横幅235pxでサムネイルを作った(235px*2(画像2枚)+10px(margin)=480px)。</p>
<p>けれども実際は両方の画像に右marginがつく為、本当のところmarginは2倍。<br />
さらに画像には1pxのborderがついてたので1画像につき+2px、合わせて4px。<br />
もう全然無理。</p>
<p>そこでサムネイルを小さく作り直せばいいのに、先日のie-css3.jsを思い出してE:nth-last-child(n)を使って2個目(最後)の画像のmarginを消してしまおう!となんか良い事を閃いた気になる。</p>
<p>そして<a href="http://sakurachiro.com/_exercise/html_css/css3-nth/#last">E:nth-last-child(n)とE:nth-last-of-type(n)の練習をしてから</a>、いざ乱雑モックアップのcssをよく見てみると画像周りのmarginは10pxじゃなくて1emだった。</p>
<p>6pxしか余裕がないところに1emもmarginがあったら右側のmarginを削除しても段落ちするし、marginを5pxくらいにすると狭すぎるしで、結局今回はサムネイルのサイズを変更するのが一番簡単な修正方法でした。</p>
<h3>前置きが長くなったけど、:nth-last-child(n)や:nth-last-of-type(n)の均等配置</h3>
<p><a href="http://sakurachiro.com/_exercise/html_css/css3-nth/last.html">乱雑モックアップ｜nth-last-childなどで均等配置テスト</a><br />
<span class="note2">html</span></p>
<pre class="brush: xml; title: ; notranslate">&lt;h1&gt;E:nth-last-child(n)&lt;/h1&gt;
&lt;div id=&quot;content&quot; class=&quot;lastchild&quot;&gt;
  &lt;div class=&quot;main&quot;&gt;メイン画像&lt;/div&gt;
  &lt;div class=&quot;sub&quot;&gt;
    &lt;p&gt;サブコンテンツ&lt;br /&gt;
      サブコンテンツ&lt;br /&gt;
      サブコンテンツ&lt;/p&gt;
  &lt;/div&gt;
  &lt;div class=&quot;sub&quot;&gt;
    &lt;p&gt;サブコンテンツ&lt;br /&gt;
      サブコンテンツ&lt;br /&gt;
      サブコンテンツ&lt;/p&gt;
  &lt;/div&gt;
  &lt;div class=&quot;sub&quot;&gt;
    &lt;p&gt;サブコンテンツ&lt;br /&gt;
      サブコンテンツ&lt;br /&gt;
      サブコンテンツ&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;</pre>
<p><span class="note3">css</span></p>
<pre class="brush: css; title: ; notranslate">body {
  font-size:80%;
}

p {
  padding:10px;
  margin:0;
}

#content {
  width:380px;
  padding:10px 10px 0 10px;
  border:1px solid SteelBlue;
}

.main {
  width:380px;
  text-align:center;
  line-height:234px;
  color:black;
  background:LightSkyBlue;
  margin-bottom:10px;
  height:234px;
}

.sub {
  width:120px;
  margin:0 10px 10px 0;
  background:aliceBlue;
  float:left;
}

#content:after{
  content:&quot;&quot;;
  display:block;
  clear:both;
}

/* ここでmargin0 */
.lastchild .sub:nth-last-child(1){
margin-right:0;
}
</pre>
<p>以前書いたこれ -&gt; <a href="http://blog.sakurachiro.com/2009/07/floatlist-justify/?preview=true&#038;preview_id=211&#038;preview_nonce=e4d4559f33">横並びにしたリストを（手動だけど）簡単に均等配置ぽく見せる</a>は、marginを左にとる必要があって今回はダメで。<br />
marginを右にとる方法を使うにしても今回は親要素が一個たりないからダメなはず(たぶん)。</p>
<p>こちらもあーだこーだやってます-&gt; <a href="http://sakurachiro.com/_exercise/html_css/css3-nth/#last">E:nth-last-child(n)とE:nth-last-of-type(n)で均等配置</a></p>
<p>それにしてもこんな使い方よりもっと別な何かで協力に威力を発揮するんじゃないだろうかって思うんだけどその何かが思いつかない。勿体無い。</p>
<p><span id="more-1642"></span></p>
<h3>ところで、</h3>
<p>WordPressで画像を挿入する時に、[配置]で左を選ぶとimgのclassにalignleftが付与される(右ならalignright)。<br />
そして、うちのcssだと
<pre class="brush: xml; title: ; notranslate">&lt;p&gt;&lt;img style=&quot;float:left&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style=&quot;float:left&quot;&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style=&quot;float:left&quot;&gt;&lt;/p&gt;</pre>
<p>なんて風に画像が並ぶと階段の様にズレてします。<br />
<img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100430-2.jpg" alt="おとなの階段上る 君はまだシンデレラさ" title="おとなの階段上る 君はまだシンデレラさ" width="480" height="296" class="alignnone size-full wp-image-1645" /></p>
<p>理由はたぶんpの中のimgのfloatが解除されずに、次のpの中のimgがfloatで回り込んでくるから高さがおかしくなっちゃうんだと思ってるんだけど、本当のところどうなんだろう?</p>
<p>原因を探すために問題を再現できるシンプルなhtmlを作って試してるんだけどmarginで階段を作ることが出来ない。<br />
paddingだと簡単に階段になるのに。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2010/04/css3-nth-last/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2010/04/css3-nth-last/" />
	</item>
		<item>
		<title>ie-css3.js ( :nth-childなどのCSS3擬似クラスをIEでも使えるようにするjs ) で失敗した事。</title>
		<link>http://blog.sakurachiro.com/2010/04/ie-css3-js/</link>
		<comments>http://blog.sakurachiro.com/2010/04/ie-css3-js/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 00:46:03 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/?p=1629</guid>
		<description><![CDATA[動作テストだからといってhtmlのhead内にcss書いて、ローカルで表示確認していたらエラーしか出なくて途方に暮れた… その原因は2つありました。 ローカルだと機能しない cssは外部化しておく 以下、使い方メモなど。 [...]]]></description>
			<content:encoded><![CDATA[<p>動作テストだからといってhtmlのhead内にcss書いて、ローカルで表示確認していたらエラーしか出なくて途方に暮れた…</p>
<h3>その原因は2つありました。</h3>
<ol>
<li>ローカルだと機能しない</li>
<li>cssは外部化しておく</li>
</ol>
<p>以下、使い方メモなど。</p>
<p><span id="more-1629"></span></p>
<p><span class="note2">ヘッダ部分の例</span></p>
<pre class="brush: xml; title: ; notranslate">&lt;!--[if lte IE 8]&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/DOMAssistantCompressed-2.8.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;js/ie-css3.js&quot;&gt;&lt;/script&gt;
&lt;![endif]--&gt;</pre>
<p><span class="note2">ie-css3.jsダウンロード先</span><br />
<del datetime="2010-09-23T09:25:57+00:00"><a href="http://www.keithclark.co.uk/labs/ie-css3/">Keith Clark &#8211; IE CSS3 pseudo-class selectors</a></del></p>
<p>IE8以下にcss3の擬似クラスを対応させるjsのバージョンが1.0になって名前と配布サイトが変わってた。<br />
<a href="http://selectivizr.com/">Selectivizr &#8211; CSS3 pseudo-class and attribute selectors for IE 6-8</a></p>
<p>ie-css3.js以外にjavascript libraryが必要、色々対応してるので好きなのを選んで使う。<br />
<a href="http://www.domassistant.com/">DOMAssistant 2.8.0</a>と併用すれば以下の擬似クラス全てに対応するようだ。</p>
<p><span class="note2">v0.9.5bで対応している擬似クラス</span><br />
<a href="http://www.keithclark.co.uk/labs/ie-css3/#supported-libaries">Supported JavaScript Libraries</a></p>
<ol style="-moz-column-count:2;-moz-column-gap:10px;-webkit-column-count:2;-webkit-column-gap:10px;">
<li>:nth-child</li>
<li>:nth-last-child</li>
<li>:nth-of-type</li>
<li>:nth-last-of-type</li>
<li>:first-child</li>
<li>:last-child</li>
<li>:only-child</li>
<li>:first-of-type</li>
<li>:last-of-type</li>
<li>:only-of-type</li>
<li>:empty</li>
<li>:enabled</li>
<li>:disabled</li>
<li>:checked</li>
<li>:hover</li>
<li>:focus</li>
<li>:target</li>
<li>::first-line</li>
<li>::first-letter</li>
</ol>
<p><a href="http://zng.info/specs/css3-selectors.html#structural-pseudos">選択子 / 6.6.5 構造上の擬似クラス</a>(日本語訳)</p>
<p><a href="http://sakurachiro.com/_exercise/html_css/css3-nth/">ie-css3.js動作確認サンプル</a><br />
確かにIEでも擬似クラスが有効になってるけど、&lt;pre&gt;のcssが無効になってる。使い方間違ってるのかな…<br />
でもどうやら@importから先のcssファイルを読み込んでくれてないみたいだ。</p>
<h3>書いてあった＞＜；；</h3>
<blockquote><p>A few things you should know:</p>
<p>    * Style sheets MUST be added to the page using a
<link> tag. You can still use @import in your style sheets. Page level style sheets won&#8217;t be parsed<br />
    * Style sheets MUST be hosted on the domain as the page.</link></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2010/04/ie-css3-js/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2010/04/ie-css3-js/" />
	</item>
		<item>
		<title>透過pngにbox-shadowを指定したらドロップシャドウみたいな効果を得られるか?</title>
		<link>http://blog.sakurachiro.com/2010/04/text-shadow-and-box-shadow/</link>
		<comments>http://blog.sakurachiro.com/2010/04/text-shadow-and-box-shadow/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 06:00:44 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/?p=1616</guid>
		<description><![CDATA[css3のbox-shadowを使うと(ベンダープレフィックスが必要だけど)簡単に影をつけられる。 でもってこれを、透過png(アルファチャンネル付きpng)に指定した場合、photoshopの対象レイヤー右クリック &#038; [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100426-4.png" alt="ドロップシャドウのイメージ" title="ドロップシャドウのイメージ" width="265" height="225" class="alignleft size-full wp-image-1620" />css3のbox-shadowを使うと(ベンダープレフィックスが必要だけど)簡単に影をつけられる。</p>
<p>でもってこれを、透過png(アルファチャンネル付きpng)に指定した場合、photoshopの<span class="note2">対象レイヤー右クリック &#8211; [レイヤー効果] &#8211; [ドロップシャドウ]</span> (もしくは<span class="note3"> [レイヤー] &#8211; [レイヤースタイル] &#8211; [ドロップシャドウ]</span>)みたいにオブジェクトの輪郭に沿って影がつくのだろうか?<br />
それとも画像の外側に四角い影がつくのだろうか?</p>
<p class="cl">ドロップシャドウのようになったら素敵だなぁと思って試してみました。</p>
<p><span id="more-1616"></span></p>
<h3>box-shadowテスト1</h3>
<p>まずは普通に。</p>
<pre class="brush: css; title: ; notranslate">
-moz-box-shadow:0 0 20px #f33;
-webkit-box-shadow:0 0 20px #f33;</pre>
<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100426-6.jpg" alt="box-shadowテスト1" title="box-shadowテスト1" width="255" height="248" class="alignnone size-full wp-image-1621" /><br />
あぁ、いきなりダメだ、切ない。</p>
<h3>box-shadowテスト2</h3>
<p>意味ないだろうけど内側に指定してみる。</p>
<pre class="brush: css; title: ; notranslate">
-moz-box-shadow:inset 0 0 100px #f33;
-webkit-box-shadow:inset 0 0 100px #f33;</pre>
<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100426-7.jpg" alt="box-shadowテスト2" title="box-shadowテスト2" width="255" height="248" class="alignnone size-full wp-image-1622" /><br />
ちゃんと画像の下に影が入ってるなぁ。</p>
<h3>text-shadowだったら?</h3>
<p>imgはインラインだし、どうだろう?</p>
<pre class="brush: css; title: ; notranslate">p ,p img{text-shadow:#f33 0 0 10px;}</pre>
<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100426-8.jpg" alt="text-shadowテスト1" title="text-shadowテスト1" width="255" height="264" class="alignnone size-full wp-image-1623" /><br />
まぁそうだろうねぇ。</p>
<h3>ちなみにIEのfilter:growだと</h3>
<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100426-9.jpg" alt="filter:grow" title="filter:grow" width="255" height="248" class="alignnone size-full wp-image-1624" /><br />
photoshopのドロップシャドウ風になってしまった。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2010/04/text-shadow-and-box-shadow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2010/04/text-shadow-and-box-shadow/" />
	</item>
		<item>
		<title>linear-gradientでグラデーションと斜めストライプ</title>
		<link>http://blog.sakurachiro.com/2010/04/linear-gradient/</link>
		<comments>http://blog.sakurachiro.com/2010/04/linear-gradient/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 04:51:40 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/2010/04/%e7%b7%a8%e9%9b%86%e4%b8%ad%ef%bd%9clinear-gradient%e3%81%a7%e3%82%b0%e3%83%a9%e3%83%87%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e3%81%a8%e6%96%9c%e3%82%81%e3%82%b9%e3%83%88%e3%83%a9%e3%82%a4%e3%83%97/</guid>
		<description><![CDATA[自分メモ これもborder-radiusのようにfirefoxとsafari,chromeで書き方が変わる。 IEはfilterを使う事でグラデーションをかけられる。 mozillaは色の区切りをpxで指定できるけどw [...]]]></description>
			<content:encoded><![CDATA[<h3>自分メモ</h3>
<p>これもborder-radiusのようにfirefoxとsafari,chromeで書き方が変わる。<br />
IEはfilterを使う事でグラデーションをかけられる。<br />
mozillaは色の区切りをpxで指定できるけどwebkitは%指定しか出来ない。</p>
<ul>
<li>firefox / -moz-linear-gradient / <a href="http://hacks.mozilla.org/2009/11/css-gradients-firefox-36/">css gradients in Firefox 3.6</a> / <a href="https://developer.mozilla.org/ja/CSS/-moz-linear-gradient">-moz-linear-gradient &#8211; MDC</a></li>
<li>safari,chrome / -webkit-gradient / <a href="http://developer.apple.com/safari/library/documentation/InternetWeb/Conceptual/SafariVisualEffectsProgGuide/Gradients/Gradients.html">Safari CSS Visual Effects Guide: Gradients</a></li>
<li>ie / filter:progid:DXImageTransform.Microsoft.gradient / <a href="http://msdn.microsoft.com/en-us/library/ms532997%28VS.85,loband%29.aspx">Gradient Filter</a></li>
</ul>
<p><span id="more-1598"></span></p>
<h4>疑問</h4>
<p> / ベンダープレフィックスを外した時、どの書き方が正式なんだろう?</p>
<p><a href="http://dev.w3.org/csswg/css3-images/#linear-gradients">w3c editor&#8217;s draft / 7.1. Linear Gradients</a>を参考にするならfirefox用の書き方が正式に近い?のかな。</p>
<blockquote><p>linear-gradient()  syntax</p>
<p>linear-gradient([&lt;bg -position> || &lt;angle>,]? &lt;color -stop>, &lt;/color>&lt;color -stop>[, &lt;/color>&lt;color -stop>]*);&lt;/color>&lt;/angle>&lt;/bg></p></blockquote>
<h3>グラデーションの使い方</h3>
<p>すでに大勢の人がlinear-gradientの記事を書いているので検索するとポンポンtipsが出てくる、感謝。</p>
<ul>
<li><a href="http://www.css-lecture.com/log/css3/css3-gradient.html">CSS3 グラデーション（gradient）の指定方法 | CSS Lecture</a></li>
<li><a href="http://hail2u.net/blog/webdesign/css-gradients-technique-1.html">hail2u.net &#8211; Weblog &#8211; CSSグラデーションのちょっとしたテクニック #1</a></li>
<li><a href="http://www.nk0206.com/life/2009/12/css3-gradient.html">CSS3のグラデーションを試してみる | A Day in the Life</a></li>
</ul>
<p>なんかだかいろんな書き方が出来るみたい。たとえばこんな感じ。</p>
<pre class="brush: css; title: ; notranslate">background-image:-moz-linear-gradient(
-90deg,/*開始位置、角度 (終了位置いらず)*/
rgb(201,201,201),/*開始色と位置:カラーコード、色名、rgb、rgbaなどで指定。半角ブランクの後に単位%やpxで位置を指定出来る(省略可)。*/
rgb(132,132,132)/*終了色*/
);
background-image:-webkit-gradient(linear,
left top, left bottom,//開始位置、終了位置
color-stop(0,rgb(201,201,201)),/*位置[0~1の間、0.25とか0.7とか],色[#rrggbb,RGB,RGBa,色の名前]*/
color-stop(1,rgb(132,132,132))
/*from(rgb(201,201,201)),開始位置*/
/*to(rgb(132,132,132))終了位置で指定してもいいしcolor-stopでもいい。*/
);</pre>
<div style="margin-bottom:1em;padding:1em;text-align:center;background-image:-moz-linear-gradient(-90deg,rgb(201,201,201),rgb(132,132,132));background-image:-webkit-gradient(linear,left top, left bottom,color-stop(0,rgb(201,201,201)),color-stop(1,rgb(132,132,132)));">こんな風なグラデーションになる。</div>
<h4>開始位置をdegで指定した場合。</h4>
<dl>
<dt>正の数</dt>
<dd><a href="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100414-1.png" rel="shadowbox[sbpost-1598];player=img;" title="+deg"><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100414-1.png" alt="" title="+deg" width="480" height="480" class="alignnone size-full wp-image-1599" /></a></dd>
<dt>負の数</dt>
<dd>
<a href="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100414-2.png" rel="shadowbox[sbpost-1598];player=img;" title="-deg"><img src="http://blog.sakurachiro.com/wp-content/uploads/2010/04/20100414-2.png" alt="" title="-deg" width="480" height="480" class="alignnone size-full wp-image-1600" /></a></dd>
</dl>
<h4>赤から青のグラデーションを例に。</h4>
<div style="width:200px;height:200px;margin-bottom:1em;color:#fff;padding:1em;text-align:center;background-image:-moz-linear-gradient(0deg,red,blue);background-image:-webkit-gradient(linear,left top, right top,color-stop(0,red),color-stop(1,blue));">0deg<br />
left top, right top,<br />
→左から右 </div>
<div style="width:200px;height:200px;margin-bottom:1em;color:#fff;padding:1em;text-align:center;background-image:-moz-linear-gradient(90deg,red,blue);background-image:-webkit-gradient(linear,left bottom, left top,color-stop(0,red),color-stop(1,blue));">90deg<br />
left bottom, left top,<br />
↑下から上</div>
<div style="width:200px;height:200px;margin-bottom:1em;color:#fff;padding:1em;text-align:center;background-image:-moz-linear-gradient(180deg,red,blue);background-image:-webkit-gradient(linear,right top, left top,color-stop(0,red),color-stop(1,blue));">180deg<br />
right top, left top,<br />
←右から左</div>
<div style="width:200px;height:200px;margin-bottom:1em;color:#fff;padding:1em;text-align:center;background-image:-moz-linear-gradient(270deg,red,blue);background-image:-webkit-gradient(linear,left top, left bottom,color-stop(0,red),color-stop(1,blue));">270deg<br />
left top, left bottom<br />
↓上から下</div>
<h3>斜めストライプの作り方</h3>
<div style="text-shadow:#fff 1px 0px,#fff 0px 1px,#fff -1px 0px,#fff 0px -1px;text-align:center;line-height:100px;margin-bottom:1em;width:480px;height:100px;-moz-background-size:50px 50px;background-image:-moz-linear-gradient(-45deg,rgba(64, 64, 64, 1),rgba(64, 64, 64, 1) 25%,rgba(230, 230, 190, 1) 25%,rgba(230, 230, 190, 1) 50%,rgba(64, 64, 64, 1) 50%,rgba(64, 64, 64, 1) 75%,rgba(230, 230, 190, 1) 75%,rgba(230, 230, 190, 1) 100%);-webkit-background-size:5px 5px;background-image: -webkit-gradient(  linear,  left top,  right bottom,color-stop(0, rgba(100, 100, 100, 1)),color-stop(0.25, rgba(100, 100, 100, 1)),color-stop(0.25, rgba(250, 250, 250, 1)),color-stop(0.50, rgba(250, 250, 250, 1)),color-stop(0.50, rgba(100, 100, 100, 1)),color-stop(0.75, rgba(100, 100, 100, 1)),color-stop(0.75, rgba(250, 250, 250, 1)),color-stop(1, rgba(250, 250, 250, 1)));">斜めストライプ</div>
<h4>firefox</h4>
<pre class="brush: css; title: ; notranslate">
-moz-background-size:5px 5px;
background-image:-moz-linear-gradient(
 -45deg,
 rgba(100, 100, 100, 1),
 rgba(100, 100, 100, 1) 25%,
 rgba(250, 250, 250, 1) 25%,
 rgba(250, 250, 250, 1) 50%,
 rgba(100, 100, 100, 1) 50%,
 rgba(100, 100, 100, 1) 75%,
 rgba(250, 250, 250, 1) 75%,
 rgba(250, 250, 250, 1) 100%
);
</pre>
<h4>Safari,Chrome</h4>
<pre class="brush: css; title: ; notranslate">
-webkit-background-size:5px 5px;
background-image: -webkit-gradient(
 linear,
 left top, right bottom,
 color-stop(0, rgba(100, 100, 100, 1)),
 color-stop(0.25, rgba(100, 100, 100, 1)),
 color-stop(0.25, rgba(250, 250, 250, 1)),
 color-stop(0.50, rgba(250, 250, 250, 1)),
 color-stop(0.50, rgba(100, 100, 100, 1)),
 color-stop(0.75, rgba(100, 100, 100, 1)),
 color-stop(0.75, rgba(250, 250, 250, 1)),
 color-stop(1, rgba(250, 250, 250, 1))
);</pre>
<h3>注意</h3>
<p>background-sizeで太さを決める<br />
5px未満にするとfirefoxで綺麗に表示されかったりした。</p>
<h4>参考｜ストライプ</h4>
<p><a href="http://ghostpia.com/sample/wft-makiba/omake.html">CSS3のgradientプロパティで斜めのストライプ背景を描いてみる</a></p>
<h4>参考｜ジェネレーター</h4>
<p><a href="http://tools.westciv.com/gradients/">http://tools.westciv.com/gradients/</a><br />
<a href="http://css-eblog.com/eblog_sample/0912/css3-generator/">CSS3プロパティジェネレーター | CSS-EBLOG</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2010/04/linear-gradient/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2010/04/linear-gradient/" />
	</item>
		<item>
		<title>webkitでは(今のところ？)border-radiusのショートハンドが使えない事とか。</title>
		<link>http://blog.sakurachiro.com/2010/04/css3-border-radius/</link>
		<comments>http://blog.sakurachiro.com/2010/04/css3-border-radius/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 15:29:36 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/2010/04/webkit%e3%81%a7%e3%81%af%e4%bb%8a%e3%81%ae%e3%81%a8%e3%81%93%e3%82%8d%ef%bc%9fborder-radius%e3%81%ae%e3%82%b7%e3%83%a7%e3%83%bc%e3%83%88%e3%83%8f%e3%83%b3%e3%83%89%e3%81%8c%e4%bd%bf%e3%81%88/</guid>
		<description><![CDATA[Firefoxだとこう書けるけどsafariやchromeではショートハンドが使えないので丸めたい角ごとに指定しないとダメみたい。 -moz-border-radius:左上 右上 右下 左下; しかもmozとwebki [...]]]></description>
			<content:encoded><![CDATA[<p>Firefoxだとこう書けるけどsafariやchromeではショートハンドが使えないので丸めたい角ごとに指定しないとダメみたい。</p>
<pre><code>-moz-border-radius:左上 右上 右下 左下;</code></pre>
<p>しかもmozとwebkitで指定が違う(面倒くさいなぁ)。</p>
<pre><code>-moz-border-radius-topleft = -webkit-border-top-left-radius
-moz-border-radius-topright = -webkit-border-top-right-radius
-moz-border-radius-bottomleft = -webkit-border-bottom-left-radius
-moz-border-radius-bottomright = -webkit-border-bottom-right-radius
</code></pre>
<p>プレフィックスを外した時どちらが正式な記述なんだろうか？<br />
<em class="note2">[追記 / 20100903]</em><br />
下記リンクを参考にするとどうやらwebkitの方が仕様に沿っているようですね。<br />
<a href="http://www.w3.org/TR/css3-background/#the-border-radius">CSS Backgrounds and Borders Module Level 3</a><br />
[追記ここまで]</p>
<p style="-moz-border-radius-topleft:10px; -webkit-border-top-left-radius:10px; padding:0.5em; border:3px solid #333;">-moz-border-radius-topleft = -webkit-border-top-left-radius</p>
<p style="-moz-border-radius-topright:10px; -webkit-border-top-right-radius:10px; padding:0.5em; border:3px solid #333;">-moz-border-radius-topright = -webkit-border-top-right-radius</p>
<p style="-moz-border-radius-bottomleft:10px; -webkit-border-bottom-left-radius:10px; padding:0.5em; border:3px solid #333;">-moz-border-radius-bottomleft = -webkit-border-bottom-left-radius</p>
<p style="-moz-border-radius-bottomright:10px; -webkit-border-bottom-right-radius:10px; padding:0.5em; border:3px solid #333;">-moz-border-radius-bottomright = -webkit-border-bottom-right-radius</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2010/04/css3-border-radius/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2010/04/css3-border-radius/" />
	</item>
		<item>
		<title>transformで回転させてみる、の続き。</title>
		<link>http://blog.sakurachiro.com/2009/12/css3-transform-rotation/</link>
		<comments>http://blog.sakurachiro.com/2009/12/css3-transform-rotation/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 21:22:14 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/?p=1511</guid>
		<description><![CDATA[先日習作したtransformで回転させてみるの続き。 位置を揃える部分でそれぞれに癖(mozilaとwebkitの回転とIEの回転の基準点が違うみたい)があるように感じたので、手順を分けてみた。 transform-o [...]]]></description>
			<content:encoded><![CDATA[<p>先日習作した<a href="http://sakurachiro.com/_exercise/html_css/css3-transform/">transformで回転させてみる</a>の続き。</p>
<p>位置を揃える部分でそれぞれに癖(mozilaとwebkitの回転とIEの回転の基準点が違うみたい)があるように感じたので、手順を分けてみた。</p>
<h3>transform-origin:の挙動を確認</h3>
<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2009/12/20091214-2.png" alt="transform-origin" title="transform-origin" width="391" height="151" class="alignnone size-full wp-image-1515" /></p>
<p><span id="more-1511"></span></p>
<p><span class="note2">Firefox、safari、chromeでのチェック</span><br />
<a href="http://sakurachiro.com/_exercise/html_css/css3-transform/90deg.html">transform: rotate(0deg)と、transform: rotate(-90deg)を適用して<br />
transform-originで基準点を変更した以下の全6種類(mozila,webkit用サンプル1)</a></p>
<pre class="brush: css; title: ; notranslate">
/* css / mozila-webkit*/
transform-origin:50% 50%;
transform-origin:0% 0%;
transform-origin:100% 0%;
transform-origin:0% 100%;
transform-origin:100% 100%;
</pre>
<p><a href="http://blog.sakurachiro.com/wp-content/uploads/2009/12/20091214-3.png" rel="shadowbox[sbpost-1511];player=img;" title="90deg"><img src="http://blog.sakurachiro.com/wp-content/uploads/2009/12/20091214-3-310x480.png" alt="90deg" title="90deg" width="310" height="480" class="alignnone size-large wp-image-1512" /></a></p>
<p><span class="note2">IEでのチェック</span><br />
<a href="http://sakurachiro.com/_exercise/html_css/css3-transform/ie-filter.html">filterを使って回転させた時の挙動(IE用サンプル)</a></p>
<pre class="brush: css; title: ; notranslate">/* css / ie*/
filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);</pre>
<p><img src="http://blog.sakurachiro.com/wp-content/uploads/2009/12/20091214-5.png" alt="filter" title="filter" width="241" height="241" class="alignnone size-full wp-image-1514" /><br />
IE6と7で微妙にズレるのは何故だろう…</p>
<h3>mozilaとwebkitを、IEの位置に合わせる</h3>
<p><a href="http://sakurachiro.com/_exercise/html_css/css3-transform/90deg-translate.html">-100%を指定して要素のwidth分、左(画面下)に移動させる。(mozila,webkit用サンプル2)</a><br />
IEをmozilaとwebkitに合わせてもいいのかもしれないけど、mozilaとwebkitの方がコントロールしやすいのでtransform:translate();を使ってこっちを動かす。<br />
結果、以下の指定でIEと同じ回転になるっぽい</p>
<pre class="brush: css; title: ; notranslate">/* css / mozila-webkit*/
transform-origin:0% 0%;
transform: rotate(-90deg) translate(-100%);
</pre>
<p><a href="http://blog.sakurachiro.com/wp-content/uploads/2009/12/20091214-4.png" rel="shadowbox[sbpost-1511];player=img;" title="-100%"><img src="http://blog.sakurachiro.com/wp-content/uploads/2009/12/20091214-4-253x480.png" alt="-100%" title="-100%" width="253" height="480" class="alignnone size-large wp-image-1513" /></a></p>
<h3>完成(たぶん)</h3>
<p><a href="http://sakurachiro.com/_exercise/html_css/css3-transform/position.html">それぞれの指定を合成してみるとこうなる(IE,mozila,webkit用サンプル)</a></p>
<p>出来上がったcssはこんな感じ。</p>
<pre class="brush: css; title: ; notranslate">
/*ie*/
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

/*firefox*/
-moz-transform-origin:0% 0%;
-moz-transform: rotate(-90deg) translate(-100%);

/*safari,chrome*/
-webkit-transform-origin:0% 0%;
-webkit-transform: rotate(-90deg) translate(-100%);

/*いずれopera*/
transform-origin:0% 0%;
transform: rotate(-90deg) translate(-100%);
</pre>
<p>もう少し判りやすく書きたいなぁ。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2009/12/css3-transform-rotation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2009/12/css3-transform-rotation/" />
	</item>
		<item>
		<title>tableにborder-radiusが効かない(ように見えた)</title>
		<link>http://blog.sakurachiro.com/2009/10/border-radius/</link>
		<comments>http://blog.sakurachiro.com/2009/10/border-radius/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 17:02:27 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/2009/10/table%e3%81%abborder-radius%e3%81%8c%e5%8a%b9%e3%81%8b%e3%81%aa%e3%81%84%e3%82%88%e3%81%86%e3%81%ab%e8%a6%8b%e3%81%88%e3%81%9f/</guid>
		<description><![CDATA[tableにborder-radiusを指定したけどガチガチの直角にしかならなかった。 なぜだろうと実験してみたところ、border-collapse:collapse;があるとborderはガチガチになるみたい。 しか [...]]]></description>
			<content:encoded><![CDATA[<p>tableにborder-radiusを指定したけどガチガチの直角にしかならなかった。<br />
なぜだろうと<a href="http://sakurachiro.com/_exercise/html_css/css3-border-radius/">実験してみたところ</a>、<span class="note2">border-collapse:collapse;</span>があるとborderはガチガチになるみたい。</p>
<p>しかしどうも各セル(th,td)のbackgroundにはborder-radiusが効いてる雰囲気。</p>
<p>確認用html<br />
<a href="http://sakurachiro.com/_exercise/html_css/css3-border-radius/">tableにはborder-collapse:collapse;とborder-radiusを組み合わせられない？</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2009/10/border-radius/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2009/10/border-radius/" />
	</item>
		<item>
		<title>CSS3 / テキストを選択した際のハイライト表示のコントロールが</title>
		<link>http://blog.sakurachiro.com/2009/10/css3-selection/</link>
		<comments>http://blog.sakurachiro.com/2009/10/css3-selection/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 12:45:16 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/2009/10/%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%82%92%e9%81%b8%e6%8a%9e%e3%81%97%e3%81%9f%e9%9a%9b%e3%81%ae%e3%83%8f%e3%82%a4%e3%83%a9%e3%82%a4%e3%83%88%e8%a1%a8%e7%a4%ba%e3%81%ae%e3%82%b3%e3%83%b3%e3%83%88/</guid>
		<description><![CDATA[css3にテキスト選択時のハイライト表示色を変更する::selectionてのがありました。 確認用html / http://sakurachiro.com/_exercise/html_css/css3-select [...]]]></description>
			<content:encoded><![CDATA[<p>css3にテキスト選択時のハイライト表示色を変更する<span class="note3">::selection</span>てのがありました。</p>
<p>確認用html / <a href="http://sakurachiro.com/_exercise/html_css/css3-selection/">http://sakurachiro.com/_exercise/html_css/css3-selection/</a></p>
<p>試しに以下のcssをコピペして<br />
Firefoxで確認してもらうとハイライト部分の色が変わるです。</p>
<pre class="brush: css; title: ; notranslate">
::-moz-selection{
color:#fff;
background:#ff7200;
}
::selection {
color:#fff;
background:#ff7200;
}
</pre>
<p>ありました、と書いたわけは<br />
<a href="http://www.w3.org/TR/css3-selectors/#selectors">W3C Working Draft 10 March 2009</a>で<span class="note2">E::selection</span>を確認できなかったからです。</p>
<p>selectionで検索すると<br />
<a href="http://www.w3.org/TR/css3-selectors/#UIfragments">http://www.w3.org/TR/css3-selectors/#UIfragments</a></p>
<blockquote cite="http://www.w3.org/TR/css3-selectors/#UIfragments"><p>7.3. Blank</p>
<p>This section intentionally left blank. (This section previously defined a ::selection pseudo-element.) </p></blockquote>
<p>という部分がヒットしてそのname属性UIfragmentsとは何だろうと検索したら以下のページがヒットしたです。</p>
<p><a href="http://www.tagindex.com/cgi-lib/q1bbs/patio.cgi?mode=view&#038;no=4248">http://www.tagindex.com/cgi-lib/q1bbs/patio.cgi?mode=view&#038;no=4248</a></p>
<blockquote cite="http://www.tagindex.com/cgi-lib/q1bbs/patio.cgi?mode=view&#038;no=4248"><p>::selection は「何かメンドクセ」ということで、今年に入って CSS3 から削除されたよ。</p>
<p>http://www.w3.org/blog/CSS/2009/02/05/resolutions_51</p>
<p>    Resolved: Drop ::selection from Selectors Level 3. Rationale: It&#8217;s vastly underspecified, and implementations are not interoperable. We can add it back in Level 4 once we have a good definition.</p></blockquote>
<p>ちなみにE::selectionで検索するとデリヘルばっかりヒットするという不思議。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2009/10/css3-selection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2009/10/css3-selection/" />
	</item>
		<item>
		<title>cssセレクタ｜パターンマッチングとか</title>
		<link>http://blog.sakurachiro.com/2009/08/css%e3%81%ae%e3%82%bb%e3%83%ac%e3%82%af%e3%82%bf%e3%83%bc/</link>
		<comments>http://blog.sakurachiro.com/2009/08/css%e3%81%ae%e3%82%bb%e3%83%ac%e3%82%af%e3%82%bf%e3%83%bc/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 19:14:47 +0000</pubDate>
		<dc:creator>まこと</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[html/css]]></category>

		<guid isPermaLink="false">http://blog.sakurachiro.com/?p=411</guid>
		<description><![CDATA[外部サイトへのリンクには判りやすいアイコンをつけたいな、と思った どうせなら外部リンク一つ一つにclassを付与する方法ではなく、今まであんまり使わなかったcssの指定でなんとかならないかな、とも思った &#8216;外 [...]]]></description>
			<content:encoded><![CDATA[<p>外部サイトへのリンクには判りやすいアイコンをつけたいな、と思った<br />
どうせなら外部リンク一つ一つにclassを付与する方法ではなく、今まであんまり使わなかったcssの指定でなんとかならないかな、とも思った</p>
<p>&#8216;外部リンク アイコン&#8217;で検索したら<a href="http://www.yomotsu.net/lab/css/externallink" class="broken_link">ヨモツネット｜外部リンクだけにアイコンをつけることのできる CSS のセレクタ</a>が上位にヒットしたので参考にさせてもらい、勉強の為 <a href="http://sakurachiro.com/_exercise/stylesheet/index.html" title="属性を使った指定｜パターンマッチ（Pattern matching）">htmlにまとめる。</a></p>
<p>[追記｜2009年9月9日2:24]<br />
外部内部どっちにもアイコンが表示される不具合があったので一応修正（できてる？）</p>
<p>練習の方は</p>
<pre class="brush: css; title: ; notranslate">
a[href^=&quot;http&quot;]{
background:url();
padding-right:xxpx;
}
</pre>
<p>みたいにアイコンをbackgroundで表示してるけど、blogの方は</p>
<pre class="brush: css; title: ; notranslate">
a[href^=&quot;http&quot;]:after{
content:url(画像);
}
</pre>
<p>てしてた。</p>
<p>その場合 http の url にマッチしたものにアイコンをつけて、その後でhttp://blog.sakurachiro.comやhttp://sakurachiro.comと自分のドメインにマッチしたもののcontentを消す事になるんだけどcontent:noneで削除してた。</p>
<p>詳しくメモるの忘れたけど、たぶんFirefox以外のoperaやIEやwebkit系で表示すると、「http://blog.sakurachiro.com」や「http://sakurachiro.com」以下へのリンクにもこのアイコン画像（<img src="http://blog.sakurachiro.com/wp-content/themes/grunge/img/common/othersite.gif" />）が表示されてておかしいなa[href^="http"]:afterて効かないのかな？いやいや試したじゃないかと首を傾げながらcssをいじっていると<br />
content:none、これどうもFirefoxしか対応してない。<br />
でcontent:&#8221; &#8220;;でアイコンを上書きしてみたんだけど、content:&#8221; &#8220;;て大丈夫なのか？</p>
<p>もう一回ヨモツネットさんはどうやってるんだろうと確認しにいったらページが表示されなくなってた、<br />
たしか、IE6も対応するような丁寧なつくりだった記憶があるんだけど、残念。</p>
<p>[追記｜2009年9月3日15:52]</p>
<p>http://sakurachiro.com/_exercise/stylesheet/index.htmlにアップしてあるけど、もうちょっと命名法を考えないと次のサンプルを作ったときに困るんじゃないのか？＞自分</p>
<p>[/追記]<br />
例のごとくちょっと遠いところからスタートしてしまい、当初の目的を見失いつつある。</p>
<p>原理はcss3の<strong>E[foo^="bar"]</strong>を使って、httpから始まるリンクをパターンマッチさせるというもの。<br />
httpから始まるということは絶対パスというもので、絶対パスを使うと言う事は外部サイトへのリンクの可能性が強いという事だからかな？</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sakurachiro.com/2009/08/css%e3%81%ae%e3%82%bb%e3%83%ac%e3%82%af%e3%82%bf%e3%83%bc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.sakurachiro.com/2009/08/css%e3%81%ae%e3%82%bb%e3%83%ac%e3%82%af%e3%82%bf%e3%83%bc/" />
	</item>
	</channel>
</rss>

