この箇所のテキスト部分を選択してみてください。通常このサイトではグレー背景に黒文字のハイライトとなりますが、赤色背景に白文字のハイライトになっているかと思います。
CSS3から定義された"selection"という擬似要素を使っています。なお、"selection"自体は突然CSS3のセレクタから削除されたそうですが、とりあえず下記の記述で適用はされます。
--- CSSはこんな感じ ---
::selection{ /* Safari and Opera */
background:#ff0000;
color:#000;
}
::-moz-selection{ /* Firefox */
background:#ff0000;
color:#fff;
}
ちなみにこんなのもありました。以下の英文をハイライトすると画像が浮かんできます。Text + Image + CSS3 = Crazy DeliciousでhtmlとCSSが自動生成されますが、凄いなぁ!元画像はこれです。
In the 1930s, the Asahi Baseball team was made of up Vancouver's best Japanese ball players. Children as young as eight were recruited as potential players forthis prestigious team. Businesses would close their doors and the stands would be packed as the Japanese community cheered on their heroes. The Asahi first played baseball within their own community but soon took on the larger, stronger Caucasian teams. They developed their own brand of game to compensate for their small size and less powerful batting. With cat-like fielding, strategic bunting, lightening quick base running and strategic play, the Asahi became an unstoppableforce. It was David against Goliath, and for five straight years, until the bombing of Pearl Harbor, the Asahi won the Pacific Northwest Baseball Championship."It was a period when, you know, if you were Asian, especially on the WestCoast, people just thought you were almost subhuman. We didn't have the vote. There were places you couldn't go. I wondered for years why it was that all my memories of theatres are looking down and it's because we had to go upstairs. So Imean in that kind of world to be accepted as an equal, that meant a great deal."Midge Ayukawa, Asahi baseball fan. "They were our team, regardless of where you lived on the coast. They were fighting for us, fighting for all Japanese,despite the hardships that were imposed on us. They showed us they could fight.They showed us they could overcome anything." Kiyoshi Suga, Asahi secretary.On December 7, 1941, Japan bombed targets across the Pacific, including PearlHarbor and Canadians defending Hong Kong. Japanese people became the enemy, and, whether immigrants or Canadian born, they became enemy aliens. There was massevacuation of Japanese people to ghost towns, detention centres, and work camps.Some families had only 24 hours to leave their homes, but amongst their treasured possessions were Asahi photos, uniforms, scrapbooks and baseball gloves. TheJapanese community, including members of the Asahi team, was dispersed to a variety of different sites. On January 23, 1943, Ottawa passed an Order in Council under the War Measures Act that all confiscated property In the 1930s, theAsahi Baseball team was made of up Vancouver's best Japanese ball players. Children as young as eight were recruited as potential players for this prestigious team. Businesses would close their doors and the stands would be packed as the Japanese community cheered on their heroes. The Asahi first played baseball withintheir own community but soon took on the larger, stronger Caucasian teams. Theydeveloped their own brand of game to compensate for their small size and less powerful batting. With cat-like fielding, strategic bunting, lightening quick base running and strategic play, the Asahi became an unstoppable force. It was David against Goliath, and for five straight years, until the bombing of Pearl Harbor, the Asahi won the Pacific Northwest Baseball Championship. "It was a period when, you know, if you were Asian, especially on the West Coast, people justthought you were almost subhuman. We didn't have the vote. There were places you couldn't go. I wondered for years why it was that all my memories of theatresare looking down and it's because we had to go upstairs. So I mean in that kindof world to be accepted as an equal, that meant a great deal." Midge Ayukawa, Asahi baseball fan. "They were our team, regardless of where you lived on thecoast. They were fighting for us, fighting for all Japanese, despite the hardships that were imposed on us. They showed us they could fight. They showed us they could overcome anything." Kiyoshi Suga, Asahi secretary. On December 7,1941, Japan bombed targets across the Pacific, including Pearl Harbor and Canadians defending Hong Kong. Japanese people became the enemy, and, whether immigrants or Canadian born, they became enemy aliens. There was mass evacuation of Japanese people to ghost towns, detention centres, and work camps. Some families hadonly 24 hours to leave their homes, but amongst their treasured possessions were Asahi photos, uniforms, scrapbooks and baseball gloves. The Japanese community, including members of the Asahi team, was dispersed to a variety of different s