11
7

More than 3 years have passed since last update.

TwitterとLINEのシェアボタンカスタマイズ(改行タグ・半角スペース・絵文字・文中ハッシュタグ)

Last updated at Posted at 2021-09-03

基本フォーマット

Twitter

https://twitter.com/share?url=[URL]&text=[テキスト]&hashtags=[ハッシュタグ1,ハッシュタグ2]

▼例

<a href="https://twitter.com/share?url=https://omochilab.net/&text=Webデザイナー真符の個人サイトです%0aウェブサイトはこちら▼%0a&hashtags=デザイン,WEBデザイナー" target="_blank">ツイートする</a>

シェアしたい[URL]と[テキスト]と[ハッシュタグ]を&で繋ぎます。
ハッシュタグはカンマ繋ぎで複数指定可能。

LINE

https://social-plugins.line.me/lineit/share?url=[URL]&text=[テキスト]

▼例

<a href="https://social-plugins.line.me/lineit/sharehttps://omochilab.net/&text=Webデザイナー真符の個人サイトです%0aウェブサイトはこちら▼%0a" target="_blank">LINEに送る</a>

改行や半角スペース、絵文字の入れ方

%0a 改行
%20 半角スペース
絵文字はそのまま書いてOK

テキスト内にハッシュタグを入れたい時

#%23に変更し、前後に半角スペース%20を入れる。
▼例
%20%23ハッシュタグ%20

<a href="https://twitter.com/share?url=https://omochilab.net/&text=Webデザイナー真符の個人サイト「%20%23おもちラボ%20」です%0aウェブサイトはこちら▼✨%0a%0a&hashtags=デザイン,Webデザイナー" target="_blank">ツイートする</a>

▼実際のボタン
ツイートする

スクリーンショット 2021-09-03 15.39.10.png

11
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
7