<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>Toshiaki_Ha5491</author_name>
  <author_url>https://blog.hatena.ne.jp/Toshiaki_Ha5491/</author_url>
  <blog_title>ivoire</blog_title>
  <blog_url>https://sampleblog2037.hatenablog.com/</blog_url>
  <categories>
    <anon>JavaScript</anon>
    <anon>CSS</anon>
  </categories>
  <description>言語ラベル表示同様、当サンプルブログでのコード解説用に、コードブロック右上に表示するコードも用意しました。このページでは、それらコードの導入について解説します。 （追記）モバイルでの閲覧状態をきちんと確認していなかったので、マウスホバーのないモバイルではコピーボタンが適切に表示されない問題が発生しています。後で直します。（追記ここまで） （追記）CSSを修正し、モバイル環境でも常時表示されるように修正しました。（追記ここまで） 概要 こちらの記事で解説している、コードブロック左上に言語ラベルを表示するコードにさらに追加して、コードブロック右上にコピーボタンを設置するコードです。 CSSおよび、…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsampleblog2037.hatenablog.com%2Fentry%2Fpre-code-2&quot; title=&quot;コードブロック（pre）にコピーボタンを付けるJavaScript + CSS（2025/08/11追記） - ivoire&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/T/Toshiaki_Ha5491/20250801/20250801010508.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2025-08-01 00:14:00</published>
  <title>コードブロック（pre）にコピーボタンを付けるJavaScript + CSS（2025/08/11追記）</title>
  <type>rich</type>
  <url>https://sampleblog2037.hatenablog.com/entry/pre-code-2</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
