input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
花粉症が今年はクッソ辛いyanagimachiです。 「スギ花粉症の根本治癒を目的とした次世代型ワクチン」が臨床試験に入るニュースを見たので、実用化されたらとりあえずスギの花粉症だけでも早めにどうにかしたいところです。 さて、先日PCでtableが横スクロールする案件がありました。 とはいえ、サイトの幅が広いとかモジュール化によって中身が足りないtableだってあるわけで、そういう時はなんかうまく幅の指定が動かない時があります。 今までスマホの時は幅が狭かったり、中身が多かったりで大丈夫だったのに、PCだとうまくいかない時のTIPをご紹介します。 HTMLは以下のようなものとします。 <div class="mod-tbl"> <table> //中身 </table> </div><!-- /.mod-tbl --> いままでの実装 tableを囲む.mod-tblに スクロールのove
対象とするテーブルではヘッダ部をthead要素内に記述し、ボディ部と分離しておきます。 <table> <thead> <tr> <th>A</th> <th>B</th> </tr> </thead> <tbody> <tr> <td>1</td> <td>1</td> </tr> </tbody> </table> theadとtbodyをブロック要素とし、tbodyのoverflowをscrollとします。 <style type="text/css"> thead, tbody { display: block; } tbody { overflow-x: hidden; overflow-y: scroll; height: 100px; } </style> このoverflowをautoとした場合、Internet ExplorerやFirefoxではスクロールバーが右端のセ
jQueryのslideToggleを使った、クリックで開閉するアコーディオンメニュー(開閉パネル)を、8種類実装しました。 クリックしたときに開いたままにしておくものや、マウスオーバー時にスタイルを変える、開いたアコーディオンメニュー以外は自動で閉じる、最初から開いておく、閉じるボタンで閉じる、多階層のアコーディオンメニュー、アンカーリンクをクリックで、スクロール&該当アコーディオンメニューの開閉などのサンプルです。 ナビゲーションメニュー関連記事cssで要素を上下左右に中央寄せするサンプル スクロールしてもコンテンツの範囲内を固定されて追従するサイドメニューの作り方【jQuery】 スマホでスクロールできちゃう!横からスライドして出てくるドロワーメニューのサンプル【jQuery】 jQueryとcssでハンバーガーメニューの開閉ボタンをアニメーション付きで変化させる cssで作る、横並
背景 スマホやタブレットで見ると、デフォルトのラジオボタンやチェックボックスって小さくて使い辛いですよね。そこで、ラジオボタンとチェックボックスの大きさを変更したいものの、jQueryとか画像とかは使いたくない。 ということで、CSSのみで変更する方法を試してみました。
色の指定については、CSSの色指定をご覧ください。 CSSの色指定 疑似クラスの指定方法については、下記のページをご覧ください。 疑似クラスの指定 指定方法 次のように、リンクの4つの状態に対して文字色を指定することができます。 a:link { color: #0000ff; } … 未訪問のリンク a:visited { color: #000080; } … 訪問済みのリンク a:hover { color: #ff0000; } … ポイント時のリンク a:active { color: #ff8000; } … 選択中のリンク link 、visited、hover、active の順で記述する必要があります。 使用例 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org
Media Query とは CSS3 から導入される Media Type を大幅に拡張する仕様です。 そもそも Media Type とは Media Type とは CSS 2 系に元々ある仕様で CSS を適用するメディア(パソコンの画面、テレビ、プリンタ用紙など)を指定するときに使います。 以下の例だと、 media 属性の中に記述されている all や screen や print が Media Type です。 <link rel="stylesheet" type="text/css" href="共通の.css" media="all" /> <link rel="stylesheet" type="text/css" href="パソコンの画面の.css" media="screen" /> <link rel="stylesheet" type="text/css"
こんにちは! ヨス(プロフィールはこちら)です。 今現在、Google検索では「スマホ対応」がされているかどうかは超重要になっています。 具体的にいうと、PCの検索順位はスマホでの検索順位が適応されているのです! 今回は、ブログのスマホ対応でのポイントをくわしく解説します。 スマホ対応で困った6つのこと 今回は私がスマホ対応のために最低限やっている6つを紹介するのですが、分かりやすいように「問題点」を見出しにして紹介しますね。 スマホで見たら画像がはみ出す?! まずはこちらの比較画像をご覧ください。 画像サイズ(左: 変更前・右: 変更後) スマホで見た時に、上画像の左側のような画像を見たことありませんか? これは画像サイズがパソコンのままになっているんですね。大きいのではみ出しています。 これをスマホで見た時は自動で上画像の右側のように縮小してほしいんです。 でも大丈夫! CSSの<im
最近改めて CSS の基本、要素の配置、レイアウトについて学習しました。過去に CSS でのレイアウトなどの記事を書いた事があるんですけど、改めて勉強してみたら、いろいろ間違えて解釈していたなー ... っていうか、基本が分かってなかったんだなーと反省 ...。今回は CSS の基本中の基本、視覚整形モデルについてまとめてみました。 Webデザインをする上で、必須とも言えるのが CSS …。このブログ – Webデザインレシピでも、過去に CSS について書いた記事がいくつかあります。最近 … でもないけど、以下のふたつは CSS でのレイアウトについて、いろいろと書いた記事でした。 CSSでレイアウトするなら絶対覚えておきたいブロックレベル要素のクセとかいろいろ – 2011年 6月17日 CSS:初心者の頃にハマったスタイルシートのあれこれ … IE7多め -2011年 4月21日 で
CSSによって、要素を左右に並べる方法について考えます。並べたときの幅まで考慮する方法については、多段レイアウトで解説します。 パターン1 <div> 左 <span style="float: right">右</span> </div> <div style="clear: right">後続する要素</div> 右寄せする要素にのみ、float:rightを適用する。 後続する要素がfloatの影響を受けないように、clearを指定する。
CSS の display プロパティについて紹介します! display: inline・display: block・display: inline-blockについてのおさらい。HTMLとCSSひよこちゃん向け! いろいろ便利な CSS の display プロパティ。今回は display: inline display: block display: inline-block についておさらいしてみます。HTMLひよこちゃん向けの記事です! displayプロパティで、ブロック・インライン・インラインブロックをおさらいしてみた displayプロパティ displayは、要素の「表示形式」を指定するプロパティ。 ブロックレベル要素をインライン形式で表示したり、インライン要素をブロックレベル形式で表示することができます。 構造的にはブロックレベル要素なんだけど、インラインとして表示
ある要素をposition:absolute;やposition:fixed;で配置する場合、topやleftで要素の位置を調整しますが、要素の左上が指定された位置に配置されます。なので、以下のようにtopとleftを50%にしてもきれいに中央に配置することはできません。 <div id="neko"> <img src="neko.jpg" /> </div> #neko img{ position:fixed; top:50%; left:50%; } このようにCSSで指定した場合、画像の左上が中央になるため、画像自体は中央からずれてしまいます。 今回は、このような場合に画像などの要素をきれいに中央配置する方法を紹介します。positionプロパティの詳細については、要素を柔軟に配置するプロパティ「position」をご参照ください。 position:absolute;やposit
注意 HTML5 からは 見た目は CSS に任せ、HTML は文書の構造(セマンティック)を表すことのみに重点を置かれるようになりました。例えば箇条書きリストを作るのに div と display: list-item; を使って構築するより、箇条書きリストを表す ul li を使ったほうがよりセマンティックです。このように目的にあった HTML 要素を使うようにしてください。 ボックスモデルとは CSS でレイアウトをする際には、 ボックスモデル を理解する必要があります。 CSS の定義するボックスモデルは以下の図のように 4つの領域で構成されています。 ボックスモデル解説図 content(コンテンツ) テキストや画像など、要素そのものの内容が表示される領域です。この領域のサイズは width(幅) と height(高さ)プロパティで指定することができます。 padding(パデ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く