Y38design

プロダクトデザインをはじめとして、
Webデザイン、グラフィックデザインなどを手がけるデザイナーY38のサイトです。

Blog

Categories

cssでリボン


デモ
html

<div>
<p>この見出しは画像なしです。</p>
</div>

css

div{
margin:100px;
background:#ccc;
padding:5em 5em 5em 0;
}
p{
background:#888;
color:white;
padding:.5em 1em;
margin:0 0 0 -20px;
position:relative;
}
p:before{
content:"";
display:block;
width:0;
height:0;
position:absolute;
left:0;
bottom:-10px;
border-right:20px solid #444;
border-bottom:10px solid #fff;
}

cssで吹き出し


デモ
html

<div>
この吹き出しは画像を使っていません。
</div>

css

div{
margin:100px;
padding:2em;
border-radius:1em;
background:#ccc;
position:relative;
}
div:before{
content:"";
display:block;
width:0;
height:0;
position:absolute;
left:-1em;
bottom:0;
border-top:1em solid #ccc;
border-left:1.5em solid transparent;
border-bottom:1em solid transparent;
}

cssでドロップダウンメニュー

デモ
html

<ul>
<li>
<a href="#">menu</a>
<ol>
<li><a href="#">submenu</a></li>
<li><a href="#">submenu</a></li>
<li><a href="#">submenu</a></li>
</ol>
</li>
</ul>

css

ul li{
float:left;
margin:0 2em 0 0;
position:relative;
background:#ccc;
padding:.5em 1em;
}
ol{
display:none;
}
ol li{
background:#888;
}
ol li a{
color:white;
}
ul li:hover > ol{
display:block;
position:absolute;
top:2em;
left:0;
}

cssでパンクズリスト


このパンくずリストは画像を使っていません。
デモ
html

<ul>
<li><a href="">Home</a></li>
<li><a href="#">contents1</a></li>
<li><a href="#">contents2</a></li>
<li><a href="">contents3</a></li>
</ul>

css

li{
float:left
display:block;
float:left;
background:#ccc;;
line-height:2;
position:relative;
padding:0 1em 0 2.5em;
margin:0 1px 0 -.5em;
}
li:after{
content:"";
display:block;
position:absolute;
left:100%;
top:0em;
line-height:2;
line-height:.5em;
border-left:1em solid #ccc;
border-top:1em solid transparent;
border-bottom:1em solid transparent;
width:0;
height:0;
z-index:2;
}
li:before{
content:"";
display:block;
position:absolute;
left:100%;
top:0em;
line-height:2;
line-height:.5em;
border-left:1em solid #fff;
border-top:1em solid transparent;
border-bottom:1em solid transparent;
z-index:1;
width:0;
height:0;
margin:0 0 0 2px;
}
li:last-of-type:after{
content:none;
}

自社サイト完成

自社サイト、一応の完成をみた。
何者にも染まらない、白をベースに仕上げた。
かたまったイメージをもたせないため、タイポグラフィをメインにデザインした。
使える写真素材がなかったため、図やアイコンをイチから作っていった。
ライティングをベースにして図化するのは、いいイメージがなかなか浮かんでこず苦戦した。
そう、ロゴデザインも自分の案。なかなかシンプルで明快なロゴができたと思う。
サイトの色はロゴの色にひっぱられすぎな印象もあるけど。なのでボタンには、さし色でピンクをいれてみた。
はて、これからどうやって育っていくサイトになるだろうか。
日頃のメンテをしっかりしてSEO対策していかねば。
そして逐次いいイメージができあがれば、図やアイコンもかえていきたい。

復職

この10月から、地元のWebデザイン会社に雇ってもらえた。
ただいま一日5時間勤務のアルバイトととして就労中。
リハビリにはちょうどよい勤務時間。
通院していることも了承してくれて感謝。
さて、早速自社のロゴデザインをさせてもらった。なかなかいい案が出たと思う。
自分の提案したものが採用されると嬉しいな。
そして今、自社サイトを新たにすべくデザインしてる。
画像だらけじゃなくタイポグラフィメインで余白でデザインするような感じなので、コーディングしながらデザインしてる。
ライティングもまだ悩み中、デザインもまだ悩み中。
でも自社のサイトのデザインが思考がストレートに反映できるし、自由度も高いから一番楽しいかも。
よいサイトになるように頑張ろう。

CMSDにて、アイテムがない時にはその親要素を表示させないようにする

<article>
<h3>その他</h3>
<ul>
<cmsd:entrylist name="foo" design="default" rows="100" />
</ul>
</article>

とある場合、エントリーが何も無くてもarticle、h3、ulまで表示されてしまう。
ので、
<article id="bar">
<h3>その他</h3>
<ul>
<cmsd:entrylist name="foo" design="default" rows="100" />
</ul>
</article>

と、article(親要素)に例えばidをあたえ、
cssで、
article#bar{
display:none;
}

と非表示にしてやる。
そしてjqueryの以下のjsを読み込ませ、エントリがある場合(この場合はliがある場合)には、親のarticleにdisplayというクラスを与え、
$(document).ready(function(){
$("article#bar:has(li)").addClass("display");
});

cssにて
article#bar.display{
display:block;
}

displayクラスを表示させる。

メールフォームスパム防止

[Z]ZAPAブロ〜グ2.0より。
hidden属性を増やし、「スパム防止用」に何か入力されてたらエラーを吐き出させる
<input type="hidden" name="スパム防止用" value="" />
とか
フォーム要素をjsではきださせるようにして、html上に見せない
<script type="text/javascript" src="mailform/foo.js"></script>
document.write('<form>〜〜〜〜〜</form>');
とか。

CSS3 PIE

たった一行を追加するだけでIE6/7/8をCSS3対応にする -CSS3 PIEのとおり、簡単にcss3をieにも適用できるのだが、
罠がふたつ。
対処法は以下の通り。
PIE.htc使うとき①.htaccess②position:relative; を確認

1.PIE.htcを読み込まない
HTC (Behavior)ファイル使用の共通注意点 [www.minc.ne.jp]
.htaccessに AddType text/x-component .htc が必要。
2.動いたが要素のバックの色が消えてしまう
CSS3 PIEでつまづいた点 « minimo [www.minimo.jp]
にある通り、position: relative; が必要。

Reset css

拾って来たリセットCSSにちょっと修正。
これをリセット用に使おう。
/*
RESET.CSS
html5doctor.com Reset Stylesheet
v1.4.1.0
Author: Richard Clark - https://richclarkdesign.com
2010-03-02 Changed by Brionac,inc. Azuma
*/
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, figcaption, figure,
footer, header, hgroup, menu, nav, section, summary,
time, mark, audio, video {
margin:0;
padding:0;
border:0;
outline:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
}
input[type=radio]{
position:relative;
top:-2px;
}
*:first-child+html input[type=radio]{
top:1px
}
em,strong,address{
font-weight:normal;
font-style:normal;
}
body {
line-height:1;
}
article,aside,canvas,details,figcaption,figure,
footer,header,hgroup,menu,nav,section,summary {
display:block;
}
ul,ol {
list-style:none;
}
blockquote, q {
quotes:none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content:'';
content:none;
}
a {
margin:0;
padding:0;
border:0;
font-size:100%;
vertical-align:baseline;
background:transparent;
outline:0;
transition: all .3s ease-in-out;
-moz-transition:all .3s ease-in-out;
-webkit-transition: all .3s ease-in-out;
}
a:hover,
a:focus{
filter: alpha(opacity=80);
opacity:0.8;
}
ins {
background-color:#ff9;
color:#000;
text-decoration:none;
}
mark {
background-color:#ff9;
color:#000;
font-style:italic;
font-weight:bold;
}
del {
text-decoration: line-through;
}
abbr[title], dfn[title] {
border-bottom:1px dotted #000;
cursor:help;
}
table {
border-collapse:collapse;
border-spacing:0;
}
hr {
display:block;
height:1px;
border:0;
border-top:1px solid #000;
margin:0;
padding:0;
clear:both;
}
*html body hr{
margin:-1em 0 0 0;
}
input, select {
vertical-align:middle;
}

to Top
Menu