This page requires a Javascript enabled browser
ヨーロッパ系の言語では基本的に単語の途中に折り返しを入れません。しかし、幅の狭い領域に長い英単語を記述するときや、笑いを表す「www…www」のように欧文文字を表現に組み込むときなど、欧文文字同士の合間で折り返したいと思うかもしれません。そのような折り返しの制御を CSS で行うにはどうすればよいのでしょうか。 2013 年 6 月時点の結論 word-wrap: break-word を使うとどうなるのか word-break: break-all を使うとどうなるのか word-wrap: break-word と word-break: break-all を両方使うとどうなるのか なぜ word-break: break-all ではなく word-wrap: break-word を勧めるのか どこに word-wrap: break-word を指定するのか position:
AppleがWebKitに-webkit-image-set()なるものを実装した。 Changeset 111637 – WebKit ― Implement image-set Bug 80322 – Implement image-set なにかというと、Retina displayやらPCとデバイスピクセル比が違うディスプレイに対して、違う画像を出し分ける、いわゆるResponsive imagesと呼ばれてるやつのための仕組み。 こんな感じで書くらしい。 selector { background: -webkit-image-set( url(foo-lowres.png) 1x, url(foo-highres.png) 2x ) center; image-set()内には複数の"imagespec"というものが入る。imagespecは<image>(画像、グラデーション
CSS with a minimal footprint.Pure is ridiculously tiny. The entire set of modules clocks in at 3.5KB* minified and gzipped. Crafted with mobile devices in mind, it was important to us to keep our file sizes small, and every line of CSS was carefully considered. If you decide to only use a subset of these modules, you'll save even more bytes. * We can add correctly :) the numbers above are individu
Stylus + Nib を使ってみた Sass の Compass インスパイアードな Stylus のライブラリ Nib を使ってみました。よく使うベンダープリフィックスやグラデーション、clearfix 等の便利な mixin の詰め合わせです。インストールについてはこちら(Stylus, Nib, node-canvas をインストール)。 Stylus って何?という方は公式(LearnBoost/stylus - GitHub, Stylus - Expressive, dynamic, robust CSS)や Kyosuke hamalog (Sass と LESS 以外の選択肢 Stylus) 等をどうぞ。 この記事は Less & Sass Advent calendar 2011 に触発されて書きました。Less, Sass(, Stylus) についての面白くって為
CSS Preprocessor Advent Calendar 2012 19日目の記事です。 CSS Preprocessorは、CSSに拡張機能を持たせるメタ言語と呼ばれるものです。 CSS Preprocessorでよく耳にするものに、SassやLessがあります。 私も以前からSassを使用していましたが、最近Stylusを使い始めたので、SassとStylusの比較を行ってみます。 拡張子とシンタックス 使用できる拡張子は.sassと.scssの2つ。 拡張子によってSass記法かSCSS(Sassy CSS)記法に分かれます。 Sass記法(.sass) #header color: #000 h1 font-size: 2em SCSS記法(.scss) #header { color: #000; h1 { font-size: 2em; } } SCSS記法の方がもとも
IntroductionThe CSS Flexible box module level 3 — or Flexbox for short — brings with it a lot of power and some very exciting possibilities for web development, allowing us to put together complex site layouts easily and rapidly, and dispensing with some of the illogical hacks and kludges that we’ve traditionally used. I dealt with the basics of Flexbox in my article Flexbox: fast track to layout
Nib CSS3 extensions for Stylus Nib is a small and powerful library for the Stylus CSS language, providing robust cross-browser CSS3 mixins to make your life as a designer easier. body { background: linear-gradient(top, white, black); } body { background: -webkit-gradient(linear, left top, left bottom, color-stop(0, #fff), color-stop(1, #000)); background: -webkit-linear-gradient(top, #fff 0%, #000
Feature detection via JavaScript is a client side best practice and for all the right reasons, but unfortunately that same functionality hasn't been available within CSS. What we end up doing is repeating the same properties multiple times with each browser prefix. Yuck. Another thing we do check for CSS property support with JavaScript which leads to brief flashes of content, hopeful code and
ブラウザーがCSSをパースする際、不明なセレクターに遭遇するとどうなると思いますか? 実はそのセレクターを含むルール全体が無視されます。何を当たり前のことを言っているんだと思われるかもしれませんが、そのルールが複数のセレクターを持っていて、そのうちひとつだけが不明なものだとしてもルール全体が無視されるということはあまり知られていないような気がします。知られていないというよりも意識する必要があまりなかったという方が近いですかね。 つまり以下のようなCSSコードは無意味です。 :-moz-any(article, aside, nav, section) h1, :-webkit-any(article, aside, nav, section) h1, :matches(article, aside, nav, section) h1 { color: red; } CSS4の:matche
💡 Personal notes about somthing I'm interested in How CSS Handles Errors - Tab Completionにて、CSSのパースで問題が発生した場合に、ブラウザがどのようにハンドリングするかの紹介がされています、という内容の紹介。仕様の4.2 Rules for handling parsing errorsや、4.1.7 Rule sets, declaration blocks, and selectorsで説明されているものと内容的には同じですけど。 At any given time, when parsing a CSS stylesheet, the browser is either trying to build an at-rule, a style rule, or a declaration (/
そういえば、Firefox 16とOpera 12.10からメディアクエリーのresolutionとdppxが使えるのを思い出した。 これらを使うと、Retina displayはじめ高密度なディスプレイに対応するコードがけっこう短くなる。 これまではこんな感じ。 @media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: 2/1) { .foo { background-image: url(image-2x.png); } } } device-pixel-ratioはもともとWebKitの拡張だったもの。それをMozillaとOperaも取り入れたのだけど、ベンダー接頭辞の面倒さに加えてmin-/max-のつき方、値の書き方がばらばら
PC 版の Google Chrome や Safari で見たときにユーザビリティーが落ちるから。 以上。 で終わってしまうと記事にならないので、ちゃんと説明しておく。 そもそも -webkit-text-size-adjust とは何か iPhone や Android のブラウザーは、縦向き (Portrate mode) と横向き (Landscape mode) の文字サイズを自動調整する機能がある。 これを制御するのが CSS の -webkit-text-size-adjust である。 文字サイズ自動調整の具体例 次のような HTML をスマートフォンで表示してみる。 <!DOCTYPE html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-
jQuery UI 1.7 and higher are built around a themable CSS framework with semantic naming conventions. The new CSS framework is built to support not only jQuery UI's own plugins, but also custom plugin development. The framework itself is static with comment tokens which can be manipulated by ThemeRoller to generate a customized look and feel. Framework adoption will promote shared markup convention
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く