<?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>zaru blog &#187; デザイン_HTML_CSS</title>
	<atom:link href="http://zaru.tofu-kun.org/category/html_css/feed/" rel="self" type="application/rss+xml" />
	<link>http://zaru.tofu-kun.org</link>
	<description>Web系のこととかー。</description>
	<lastBuildDate>Fri, 18 Nov 2011 02:28:49 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://zaru.tofu-kun.org/category/html_css/feed/" />
		<item>
		<title>覚えて良かったCSSテクニック</title>
		<link>http://zaru.tofu-kun.org/2010/04/22/%e8%a6%9a%e3%81%88%e3%81%a6%e8%89%af%e3%81%8b%e3%81%a3%e3%81%9fcss%e3%83%86%e3%82%af%e3%83%8b%e3%83%83%e3%82%af/</link>
		<comments>http://zaru.tofu-kun.org/2010/04/22/%e8%a6%9a%e3%81%88%e3%81%a6%e8%89%af%e3%81%8b%e3%81%a3%e3%81%9fcss%e3%83%86%e3%82%af%e3%83%8b%e3%83%83%e3%82%af/#comments</comments>
		<pubDate>Thu, 22 Apr 2010 08:52:47 +0000</pubDate>
		<dc:creator>zaru</dc:creator>
				<category><![CDATA[デザイン_HTML_CSS]]></category>

		<guid isPermaLink="false">http://zaru.tofu-kun.org/?p=180</guid>
		<description><![CDATA[ここ最近、覚えてよかったなーと思ったCSSテクニックをまとめてみる CSSテクニックは時代とともに変わっていくけれど、ここ1年ほどスタメンレベルで使うCSSテクニックが絞られてきたので、ここらでちょっと個人的にもまとめておこうかと。 liをクラス指定せずに3カラムで並べる liボックス 幅：190px マージン：15px liボックス ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。 liボックス ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。 &#60;li&#62;にはクラスを指定せずに、左右にぴったりくっ付くように配置が可能。 &#60;style type=&#34;text/css&#34;&#62; #box1{ width: 600px; } ul{ width: 615px; margin: 0 -15px 0 0; overflow: hidden; _zoom: 1; font-size:77%; } li{ width: 180px; padding: 5px; margin-right: 15px; float: left; background-color: #cccccc; } &#60;/style&#62; &#60;ul&#62; &#60;li&#62;liボックス&#60;br /&#62; 幅：190px&#60;br /&#62; マージン：15px&#60;/li&#62; &#60;li&#62;liボックス&#60;br /&#62; ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&#60;/li&#62; &#60;li&#62;liボックス&#60;br /&#62; [...]]]></description>
			<content:encoded><![CDATA[<style type="text/css">
 #box_all {
	width:600px;
}
.post #box_all ul{
padding:0;
}
.post #box_all li {
	list-style-type:none;
}
#box1, #box2, #box3, #box4, #box5 {
	background-color: #eeeeee;
	margin:10px 0;
}
.post #box1 ul {
	width: 615px;
	margin: 0 -15px 0 0;
	overflow: hidden;
	_zoom: 1;
	font-size:77%;
}
.post #box1 ul li {
	width: 180px;
	padding: 5px;
	margin-right: 15px;
	float: left;
	background-color: #cccccc;
}
.post #box2 ul {
	width: 612px;
	margin: 0 -12px 0 0;
	overflow: hidden;
	_zoom: 1;
	font-size:85%;
}
.post #box2 ul li {
	width: 131px;
	padding: 5px;
	margin-right: 12px;
	float: left;
	background-color: #cccccc;
}
.post #box3_1 {
	border:1px solid #cccccc;
	background-color: #ffffff;
	padding: 5px;
	margin: 5px;
	height: 100px;
	position: relative;
}
.post #box3_1 input {
	position: absolute;
	right: 0;
	bottom: 0;
}
.post #box5 dl {
	font-size:77%;
}
.post #box5 dt {
	clear: left;
	float: left;
	margin:0 0 0.8em 0;
	width: 7.5em;
	padding:5px;
}
.post #box5 dd {
	margin:0 0 0.8em 0em;
	padding:5px 0 5px 8em;
	background-color: #cccccc;
}
hr {
	clear:both;
	margin:25px 0;
}
*html .post #box6 hr {
	display :list-item;
	width:0;
	margin-left:-10px;
	list-style :url(line.png) inside;
	color:#ffffff;
	background-color: #ffffff;
}
.post #box6 hr {
	border:0;
	height: 26px;
	background:url(http://zaru.tofu-kun.org/wp-content/uploads/2010/04/line.png) 50% 0 no-repeat;
}
</style>
<h3>ここ最近、覚えてよかったなーと思ったCSSテクニックをまとめてみる</h3>
<p>CSSテクニックは時代とともに変わっていくけれど、ここ1年ほどスタメンレベルで使うCSSテクニックが絞られてきたので、ここらでちょっと個人的にもまとめておこうかと。<span id="more-180"></span><br />
<!–more–> </p>
<div id="box_all">
<h3>liをクラス指定せずに3カラムで並べる</h3>
<div id="box1">
<ul>
<li>liボックス<br />
                幅：190px<br />
                マージン：15px</li>
<li>liボックス<br />
                ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</li>
<li>liボックス<br />
                ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</li>
</ul>
<p>&lt;li&gt;にはクラスを指定せずに、左右にぴったりくっ付くように配置が可能。</p>
</p></div>
<pre class="brush: css; title: ;">
&lt;style type=&quot;text/css&quot;&gt;
#box1{
	width: 600px;
}
ul{
	width: 615px;
	margin: 0 -15px 0 0;
	overflow: hidden;
	_zoom: 1;
	font-size:77%;
}
li{
	width: 180px;
	padding: 5px;
	margin-right: 15px;
	float: left;
	background-color: #cccccc;
}
&lt;/style&gt;
</pre>
<pre class="brush: xml; title: ;">
&lt;ul&gt;
    &lt;li&gt;liボックス&lt;br /&gt;
        幅：190px&lt;br /&gt;
        マージン：15px&lt;/li&gt;
    &lt;li&gt;liボックス&lt;br /&gt;
        ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&lt;/li&gt;
    &lt;li&gt;liボックス&lt;br /&gt;
        ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&lt;/li&gt;
&lt;/ul&gt;
</pre>
<hr />
<h3>liをクラス指定せずに4カラムで並べる</h3>
<div id="box2">
<ul>
<li>liボックス<br />
                幅：141px<br />
                マージン：12px</li>
<li>liボックス<br />
                ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</li>
<li>liボックス<br />
                ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</li>
<li>liボックス<br />
                ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</li>
</ul>
<p>もちろん、3列じゃなくて4列でも何列でもできる。</p>
</p></div>
<pre class="brush: css; title: ;">
&lt;style type=&quot;text/css&quot;&gt;
#box2{
	width: 600px;
}
ul{
	width: 612px;
	margin: 0 -12px 0 0;
	overflow: hidden;
	_zoom: 1;
	font-size:85%;
}
li{
	width: 131px;
	padding: 5px;
	margin-right: 12px;
	float: left;
	background-color: #cccccc;
}
&lt;/style&gt;
</pre>
<pre class="brush: xml; title: ;">
&lt;ul&gt;
    &lt;li&gt;liボックス&lt;br /&gt;
        幅：141px&lt;br /&gt;
        マージン：12px&lt;/li&gt;
    &lt;li&gt;liボックス&lt;br /&gt;
        ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&lt;/li&gt;
    &lt;li&gt;liボックス&lt;br /&gt;
        ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&lt;/li&gt;
    &lt;li&gt;liボックス&lt;br /&gt;
        ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&lt;/li&gt;
&lt;/ul&gt;
</pre>
<hr />
<h3>高さ指定したボックスの一番下にボタンとかを配置したい。</h3>
<div id="box3">
<div id="box3_1">
<p>高さ：100px<br />
                ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</p>
<input type="button" value="ボタン" />
</p></div>
<p>高さを揃えたいけれど、中身の要素量がバラバラ…の時にでも。</p>
</p></div>
<pre class="brush: css; title: ;">
&lt;style type=&quot;text/css&quot;&gt;
#box3_1{
	border:1px solid #cccccc;
	background-color: #ffffff;
	padding: 5px;
	margin: 5px;
	height: 100px;
	position: relative;
}
#box3_1 input{
	position: absolute;
	right: 0;
	bottom: 0;
}
&lt;/style&gt;
</pre>
<pre class="brush: xml; title: ;">
&lt;div id=&quot;box3_1&quot;&gt;
    &lt;p&gt;高さ：100px&lt;br /&gt;
        ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&lt;/p&gt;
    &lt;p&gt;
        &lt;input type=&quot;button&quot; value=&quot;ボタン&quot; /&gt;
    &lt;/p&gt;
&lt;/div&gt;
</pre>
<hr />
<h3>dt / ddを横並びにする</h3>
<div id="box5">
<dl>
<dt>dtです。</dt>
<dd>ddです。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</dd>
<dt>dtです。</dt>
<dd>ddです。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</dd>
</dl></div>
<pre class="brush: css; title: ;">
&lt;style type=&quot;text/css&quot;&gt;
dt{
	clear: left;
	float: left;
	margin:0 0 0.8em 0;
	width: 7.5em;
	padding:5px;
}
dd{
	margin:0 0 0.8em 0em;
	padding:5px 0 5px 8em;
	background-color: #cccccc;
}
&lt;/style&gt;
</pre>
<pre class="brush: xml; title: ;">
&lt;dl&gt;
    &lt;dt&gt;dtです。&lt;/dt&gt;
    &lt;dd&gt;ddです。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&lt;/dd&gt;
    &lt;dt&gt;dtです。&lt;/dt&gt;
    &lt;dd&gt;ddです。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。&lt;/dd&gt;
&lt;/dl&gt;
</pre>
<hr />
<h3>&lt;hr /&gt;に画像を使う</h3>
<div id="box6">
<p>↓&lt;hr /&gt;。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。ダミーテキスト。</p>
<hr />
<p>IE6でも表示可能だが、右はじに変な縦線が出る。背景色と罫線画像の色が一緒であれば誤魔化すことは可能。</p>
</p></div>
<pre class="brush: css; title: ;">
&lt;style type=&quot;text/css&quot;&gt;
*html hr{
	display :list-item;
	width:0;
	margin-left:-10px;
	list-style :url(line.png) inside;
	color:#ffffff;
	background-color: #ffffff;
}
hr{
	border:0;
	height: 26px;
	background:url(line.png) 50% 0 no-repeat;
}
&lt;/style&gt;
</pre>
<pre class="brush: xml; title: ;">
&lt;hr /&gt;
</pre>
</div>
<img src="http://zaru.tofu-kun.org/?ak_action=api_record_view&id=180&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://zaru.tofu-kun.org/2010/04/22/%e8%a6%9a%e3%81%88%e3%81%a6%e8%89%af%e3%81%8b%e3%81%a3%e3%81%9fcss%e3%83%86%e3%82%af%e3%83%8b%e3%83%83%e3%82%af/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://zaru.tofu-kun.org/2010/04/22/%e8%a6%9a%e3%81%88%e3%81%a6%e8%89%af%e3%81%8b%e3%81%a3%e3%81%9fcss%e3%83%86%e3%82%af%e3%83%8b%e3%83%83%e3%82%af/" />
	</item>
		<item>
		<title>Flashの上に画像やテキスト、DIVを重ねて表示する方法</title>
		<link>http://zaru.tofu-kun.org/2010/02/08/flash%e3%81%ae%e4%b8%8a%e3%81%ab%e7%94%bb%e5%83%8f%e3%82%84%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%80%81div%e3%82%92%e9%87%8d%e3%81%ad%e3%81%a6%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95/</link>
		<comments>http://zaru.tofu-kun.org/2010/02/08/flash%e3%81%ae%e4%b8%8a%e3%81%ab%e7%94%bb%e5%83%8f%e3%82%84%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%80%81div%e3%82%92%e9%87%8d%e3%81%ad%e3%81%a6%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 04:38:38 +0000</pubDate>
		<dc:creator>zaru</dc:creator>
				<category><![CDATA[デザイン_HTML_CSS]]></category>

		<guid isPermaLink="false">http://zaru.tofu-kun.org/?p=111</guid>
		<description><![CDATA[Flashの上に画像やテキストを重ねて表示できないかなーと思って試してみたら普通にできたのでまとめ。とりあえずサンプルを見るのがわかりやすい。 サンプル HTMLテキストです。 重ねて表示する方法：HTML + CSS 大事なのはFlashを描画する&#60;object&#62;タグの部分。 &#60;param name=&#34;wmode&#34; value=&#34;transparent&#34; /&#62; &#60;embed wmode=&#34;transparent&#34; ... /&#62; この2つをしているすればIE6〜／Fx3〜／Safari3〜／Chromeで、無事にDIVによるテキストの重ね合わせ・背景色の重ね合わせ、透過PNGの重ね合わせを表示できた。透過PNGに関してはIE6対策にJavaScriptのライブラリを導入している。 IE6透過PNG対策JS &#8211; DD_belatedPNG 今回初めてこの透過ライブラリ使ってみたけど、結構良いかもしれない。 #test_flash{ position:relative; } #test_hoge{ position:absolute; top:0px; left:100px; padding:10px; width:300px; color:#00f; } #test_hoge span{ background-color:#eeeeee; } &#60;script src=&#34;/DD_belatedPNG.js&#34;&#62;&#60;/script&#62; &#60;script&#62; DD_belatedPNG.fix('.png_bg');&#60;!-- IE6の透過PNG対策 --&#62; &#60;/script&#62; &#60;![endif]--&#62; &#60;div id=&#34;flash&#34;&#62; &#60;object classid=&#34;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&#34; codebase=&#34;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0&#34; width=&#34;550&#34; height=&#34;400&#34; id=&#34;test&#34; align=&#34;middle&#34;&#62; &#60;param name=&#34;allowScriptAccess&#34; value=&#34;sameDomain&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Flashの上に画像やテキストを重ねて表示できないかなーと思って試してみたら普通にできたのでまとめ。とりあえずサンプルを見るのがわかりやすい。</p>
<h3>サンプル</h3>
<p><!--[if IE 6]><br />
<script src="/DD_belatedPNG.js"></script><br />
<script>
  DD_belatedPNG.fix('.png_bg');
</script><br />
<![endif]--></p>
<style type="text/css">
#test_flash{
    position:relative;
}
#test_hoge{
    position:absolute;
    top:0px;
    left:100px;
    padding:10px;
    width:300px;
    color:#00f;
}
.post #test_flash img{
background:none;
border:0;
}
#test_hoge span{
    background-color:#eeeeee;
}
</style>
<div id="test_flash">
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="550" height="400" id="test" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="allowFullScreen" value="false" /><param name="wmode" value="transparent" /><param name="movie" value="http://zaru.tofu-kun.org/wp-content/uploads/2010/02/test.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed wmode="transparent" src="http://zaru.tofu-kun.org/wp-content/uploads/2010/02/test.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="test" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer_jp" /><br />
	</object></p>
<div id="test_hoge">
        <span>HTMLテキストです。</span><br />
        <img src="http://zaru.tofu-kun.org/wp-content/uploads/2010/02/img.png" class="png_bg" />
    </div>
</div>
<h3>重ねて表示する方法：HTML + CSS</h3>
<p>大事なのはFlashを描画する&lt;object&gt;タグの部分。</p>
<pre class="brush: xml; title: ;">
&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt;
&lt;embed wmode=&quot;transparent&quot; ... /&gt;
</pre>
<p>この2つをしているすればIE6〜／Fx3〜／Safari3〜／Chromeで、無事にDIVによるテキストの重ね合わせ・背景色の重ね合わせ、透過PNGの重ね合わせを表示できた。透過PNGに関してはIE6対策にJavaScriptのライブラリを導入している。</p>
<ul>
<li><a href="http://www.dillerdesign.com/experiment/DD_belatedPNG/" target="_blank">IE6透過PNG対策JS &#8211; DD_belatedPNG </a></li>
</ul>
<p>今回初めてこの透過ライブラリ使ってみたけど、結構良いかもしれない。</p>
<pre class="brush: css; title: ;">
#test_flash{
    position:relative;
}
#test_hoge{
    position:absolute;
    top:0px;
    left:100px;
    padding:10px;
    width:300px;
    color:#00f;
}
#test_hoge span{
    background-color:#eeeeee;
}
</pre>
<pre class="brush: xml; title: ;">
&lt;script src=&quot;/DD_belatedPNG.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;
  DD_belatedPNG.fix('.png_bg');&lt;!-- IE6の透過PNG対策 --&gt;
&lt;/script&gt;
&lt;![endif]--&gt;
&lt;div id=&quot;flash&quot;&gt;
	&lt;object classid=&quot;clsid:d27cdb6e-ae6d-11cf-96b8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0&quot; width=&quot;550&quot; height=&quot;400&quot; id=&quot;test&quot; align=&quot;middle&quot;&gt;
	&lt;param name=&quot;allowScriptAccess&quot; value=&quot;sameDomain&quot; /&gt;
	&lt;param name=&quot;allowFullScreen&quot; value=&quot;false&quot; /&gt;
	&lt;param name=&quot;wmode&quot; value=&quot;transparent&quot; /&gt;
	&lt;param name=&quot;movie&quot; value=&quot;http://zaru.tofu-kun.org/wp-content/uploads/2010/02/test.swf&quot; /&gt;
	&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;
	&lt;param name=&quot;bgcolor&quot; value=&quot;#ffffff&quot; /&gt;
	&lt;embed wmode=&quot;transparent&quot; src=&quot;http://zaru.tofu-kun.org/wp-content/uploads/2010/02/test.swf&quot; quality=&quot;high&quot; bgcolor=&quot;#ffffff&quot; width=&quot;550&quot; height=&quot;400&quot; name=&quot;test&quot; align=&quot;middle&quot; allowScriptAccess=&quot;sameDomain&quot; allowFullScreen=&quot;false&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.adobe.com/go/getflashplayer_jp&quot; /&gt;
	&lt;/object&gt;
	&lt;div id=&quot;hoge&quot;&gt;
	&lt;p&gt;HTMLテキストです。&lt;/p&gt;
	&lt;img src=&quot;http://zaru.tofu-kun.org/wp-content/uploads/2010/02/img.png&quot; /&gt;
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<img src="http://zaru.tofu-kun.org/?ak_action=api_record_view&id=111&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://zaru.tofu-kun.org/2010/02/08/flash%e3%81%ae%e4%b8%8a%e3%81%ab%e7%94%bb%e5%83%8f%e3%82%84%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%80%81div%e3%82%92%e9%87%8d%e3%81%ad%e3%81%a6%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://zaru.tofu-kun.org/2010/02/08/flash%e3%81%ae%e4%b8%8a%e3%81%ab%e7%94%bb%e5%83%8f%e3%82%84%e3%83%86%e3%82%ad%e3%82%b9%e3%83%88%e3%80%81div%e3%82%92%e9%87%8d%e3%81%ad%e3%81%a6%e8%a1%a8%e7%a4%ba%e3%81%99%e3%82%8b%e6%96%b9%e6%b3%95/" />
	</item>
	</channel>
</rss>
