Bloggerのサイドバーに表示するプロフィールカードをつくってみた

2019/11/27

Blogger


ブログでよくみかけるプロフィールカードを表示させたいと思いました。
Bloggerでも基本情報というプロフィールを表示させるものはあるのですが、編集するのは難しそうだったので別につくってみました。

プロフィールカード

HTML

Bloggerのガジェット「HTML/JavaScript」に下記HTMLをコピーしました。
Blogger以外で表示させる場合は<div>で全体を囲んで横幅を指定すればできるはずです。

  1. <p class="profile-background"><img src="【背景画像】" /></p>
  2. <div class="myprofile"> <img alt='自分の写真' class='profile-img' height='80' src='【プロフィール写真】' width='80' /></div> <br clear="left" />
  3. <p class="myname">【名前】</p>
  4. <p class="myprofile-content">【プロフィール紹介文】</p>
  5. <p class="follow">&#65340;Follow me&#65295;</p>
  6. <div class="follownav"> <a class="f-twitter" href="【Twitter URL】" target="_blank"><i class="fab fa-twitter lg my-twitter"></i><br /><span class="snsname">Twitter</span></a> <a class="f-feedly" href="【feedly URL】" target="_blank"><i class="fas fa-rss lg my-feedly"></i><br /><span class="snsname">feedly</span></a> </div>
  7. <div id="bittip">
  8. <div id="damzn"><a href="【Amazon ほしい物リストURL】">Amazon ほしい物リスト</a></div>
  9. </div>

CSS

CSSは「HTMLの編集」から行いましたが、「HTML/JavaScript」でもできる気もします。
その場合は<style type="text/css">【ここにCSS】</style>で囲む必要がありますが。

  1. .profile-background img {
  2. width: 100%;
  3. height: 130px;
  4. object-fit: cover;
  5. }
  6.  
  7. .myprofile img {
  8. width: 88px;
  9. height: 88px;
  10. position: relative;
  11. border: solid 3px #fff;
  12. border-radius: 100%;
  13. overflow: hidden;
  14. bottom: 40px;
  15. left: 50%;
  16. margin-left: -44px;
  17. margin-bottom: -40px;
  18. }
  19.  
  20. /* 名前 */
  21. .myname {
  22. margin-top: 5px;
  23. margin-bottom: 12px;
  24. padding: 0;
  25. font-family: 'Rubik', sans-serif;
  26. font-size: 0.9em;
  27. text-align: center;
  28. font-weight: 700;
  29. }
  30.  
  31. /* 紹介文 */
  32. .myprofile-content {
  33. padding: 0 7px;
  34. font-size: 0.65em;
  35. line-height: 150%;
  36. font-weight: 400;
  37. }
  38.  
  39. .follow {
  40. padding: 5px;
  41. font-family: 'Rubik', sans-serif;
  42. font-size: 0.8em;
  43. text-align: center;
  44. color: #e1e2e3;
  45. font-weight: 700;
  46. }
  47.  
  48. .follownav {
  49. margin: 0 auto;
  50. width: 80%;
  51. text-align: center;
  52. padding: 0 0 70px;
  53. }
  54.  
  55. .follownav a {
  56. width: 50%;
  57. font-size: 180%;
  58. margin: 0;
  59. padding: 0.3em 0 0 0;
  60. float: left;
  61. font-weight: bold;
  62. text-align: center;
  63. display: inline-block;
  64. text-decoration: none;
  65. line-height: 0.3em;
  66. }
  67.  
  68. .follownav a:hover {
  69. opacity: 0.8;
  70. filter: alpha(opacity=60);
  71. -moz-opacity: 0.6;
  72. }
  73.  
  74. .my-twitter {
  75. color: #44aeea;
  76. }
  77.  
  78. .my-feedly {
  79. color: #88C140;
  80. }
  81.  
  82. .snsname {
  83. color: #474a4d;
  84. font-family: 'Rubik', sans-serif;
  85. font-size: .3em;
  86. text-align: center;
  87. }
  88.  
  89. /* Amazonほしい物リスト*/
  90. #damzn {
  91. background-color: #d0baa7;
  92. background-image: -webkit-gradient(linear, 0 0, 100% 100%, color-stop(.25, #dcccbd), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, #dcccbd), color-stop(.75, #dcccbd), color-stop(.75, transparent), to(transparent));
  93. -webkit-background-size: 5px 5px;
  94. padding: 5px;
  95. text-align: center;
  96. }
  97.  
  98. #damzn a {
  99. font-size: 0.8em;
  100. display: block;
  101. color: #f3f3f3 !important;
  102. transition: all 2.5s;
  103. width: 100%;
  104. }
  105.  
  106. #damzn a:hover {
  107. letter-spacing: 2px;
  108. }

自分の写真

mimito

世界中を旅するノマドなミニマリストに憧れているものの、デザインとプログラムの間で迷子になったあげく、たくさんの物に囲まれ、引きこもりがちな生活を送っております。複雑系とか多世界解釈とかよくわからないけど、興味津々です。

Archive

Label

QooQ