カエレバ・トマレバ・ヨメレバをカスタマイズ。追加CSS:スタイルシート

Wordpressをカスタマイズ。CSSの記述場所・追加CSS・スタイルシート

 

 

デザインは「amazlet風-2(cssカスタマイズ用)を選択します。

 

 

正直言って、まだ中途半端なcssなのですが(トマレバの項目を増やしていません)こんな感じに表示されます。カーソルをあててみてください。

 

 

CSSを書く場所

 

パソコン用css

 

/*パソコン用。ヨメレバ・カエレバ・トマレバのカスタマイズ*/
.booklink-box, .kaerebalink-box, .tomarebalink-box{
padding:25px;
margin-bottom: 10px;
border:double #CCC;
overflow: hidden;
font-size:small;
}
.booklink-image, .kaerebalink-image, .tomarebalink-image{
margin:0 15px 0 0;
float:left;
min-width: 160px;
text-align: center;
}
.booklink-image img, .kaerebalink-image img, .tomarebalink-image img{
margin:0 auto;
text-align:center;
}
.booklink-info, .kaerebalink-info, .tomarebalink-info{
margin:0;
line-height:120%;
overflow: hidden;
}
.booklink-name, .kaerebalink-name, .tomarebalink-name{
border-top:5px solid #ccc;
margin-bottom:24px;
padding-top:5px;
line-height:1.5em;
}
.booklink-name a, .kaerebalink-name a, .tomarebalink-name a {
font-weight: bold;
text-decoration: none;
}
.booklink-powered-date, .kaerebalink-powered-date, .tomarebalink-powered-date{
font-size:8px;
margin-top:10px;
font-family:verdana;
line-height:120%;
border-top:1px solid #ccc;
text-align:right;
padding:2px;
}
.booklink-detail, .kaerebalink-detail, .tomarebalink-detail{font-size: 12px;}
.booklink-powered-date, .kaerebalink-powered-date, .tomarebalink-powered-date{margin-bottom:15px;}
.booklink-link2, .kaerebalink-link1, .tomarebalink-link1{margin-top:10px;}
.kaerebalink-link1 a { /* カエレバ */
width: 30%; /*横に並べたい項目が二つなら46%*/
}
.booklink-link2 a { /* ヨメレバ */
width: 30%; /*横に並べたい項目が二つなら46%*/
}
.tomarebalink-link1 a { /* トマレバ */
width: 30%; /*横に並べたい項目が二つなら46%*/
}
.kaerebalink-link1 a, .booklink-link2 a, .tomarebalink-link1 a {
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
display:inline-block;
margin:5px 2px 0 0;
padding:10px 1px;
text-align:center;
float:left;
text-decoration:none;
font-weight:800;
font-size:12px;
}
.booklink-link2 a:active .kaerebalink-link1 a:active, .tomarebalink-link1 a:active {
position: relative;
top: 1px;
}
/* amazon */
.shoplinkamazon a {
color: #FF9901 ; /*文字の色*/
border: solid 1px #FF9901 ; /*ボーダー色*/
}
.shoplinkamazon a:hover {
background-color: #ff9901; /*カーソルを重ねた時の背景色*/
}
/*楽天*/
.shoplinkrakuten a {
color: #c20004 ; /*文字の色*/
border: solid 1px #c20004 ; /*ボーダー色*/
}
.shoplinkrakuten a:hover {
background-color: #c20004; /*カーソルを重ねた時の背景色*/
}
/*kindle*/
.shoplinkkindle a {
color: #007dcd; /*文字の色*/
border: solid 1px #007dcd ; /*ボーダー色*/
}
.shoplinkkindle a:hover {
background-color: #007dcd; /*カーソルを重ねた時の背景色*/
}
/*価格*/
.shoplinkkakakucom a {
color: #314995; /*文字の色*/
border: solid 1px #314995 ; /*ボーダー色*/
}
.shoplinkkakakucom a:hover {
background-color: #314995; /*カーソルを重ねた時の背景色*/
}
/*kobo*/
.shoplinkrakukobo a {
color: #990000; /*文字の色*/
border: solid 1px #990000 ; /*ボーダー色*/
}
.shoplinkrakukobo a:hover {
background-color: #990000; /*カーソルを重ねた時の背景色*/
}
/*yahoo*/
.shoplinkyahoo a {
color: #7b0099; /*文字の色*/
border: solid 1px #7b0099 ; /*ボーダー色*/
}
.shoplinkyahoo a:hover {
background-color: #7b0099; /*カーソルを重ねた時の背景色*/
}
.shoplinkyahoo img {
display: none;
}
.shoplinkyahoo a {
font-size: 10px;
}
/*7net*/
.shoplinkseven a {
color: #82c36f ; /* 文字の色 */
border: solid 1px #82c36f ; /*ボーダー色*/
}
.shoplinkseven a:hover {
background-color: #82c36f; /*カーソルを重ねた時の背景色*/
}
/*jtb*/
.shoplinkjtb a {
color: #990000 ; /*文字の色*/
border: solid 1px #990000 ; /*ボーダー色*/
}
.shoplinkjtb a:hover {
background-color: #990000; /*カーソルを重ねた時の背景色*/
}
/*jalan*/
.shoplinkjalan a {
color: #FF9901 ; /*文字の色*/
border: solid 1px #FF9901 ; /*ボーダー色*/
}
.shoplinkjalan a:hover {
background-color: #FF9901; /*カーソルを重ねた時の背景色*/
}
.booklink-link2 a:hover,
.kaerebalink-link1 a:hover,
.tomarebalink-link1 a:hover{opacity: 0.6;}
.booklink-link2 a:active,
.kaerebalink-link1 a:active,
.tomarebalink-link1 a:active{
position:relative;
top:1px;
}
.shoplinkamazon a, .shoplinkrakuten a, .shoplinkkindle a, .shoplinkkakakucom a, .shoplinkrakukobo a, .shoplinkyahoo a, .shoplinkseven a, .shoplinkjtb a, .shoplinkjalan a {
position: relative;
-webkit-backface-visibility: hidden;
-moz-osx-font-smoothing: grayscale;
-webkit-transition: background-color 0.3s, color 0.3s;
transition: background-color 0.3s, color 0.3s;
}
.shoplinkamazon a:hover, .shoplinkrakuten a:hover, .shoplinkkindle a:hover, .shoplinkkakakucom a:hover, .shoplinkrakukobo a:hover, .shoplinkyahoo a:hover, .shoplinkseven a:hover, .shoplinkjtb a:hover, .shoplinkjalan a:hover {
-webkit-transition: background-color 0.1s 0.3s, color 0.1s 0.3s;
transition: background-color 0.1s 0.3s, color 0.1s 0.3s;
color: #fff; /*カーソルを重ねた時の文字色*/
-webkit-animation: anim-1 0.3s forwards;
animation: anim-1 0.3s forwards;
}
.shoplinkamazon a:focus, .shoplinkrakuten a:focus, .shoplinkkindle a:focus, .shoplinkkakakucom a:focus, .shoplinkrakukobo a:focus, .shoplinkyahoo a:focus, .shoplinkseven a:focus, .shoplinkjtb a:focus, .shoplinkjalan a:focus {
outline: none;
}
.shoplinkamazon a::before, .shoplinkrakuten a::before, .shoplinkkindle a::before, .shoplinkkakakucom a::before, .shoplinkrakukobo a::before, .shoplinkyahoo a::before, .shoplinkseven a::before, .shoplinkjtb a::before, .shoplinkjalan a::before {
content: '';
position: absolute;
top: -10px;
left: -10px;
bottom: -10px;
right: -10px;
background: inherit;
z-index: -1;
opacity: 0.4;
-webkit-transform: scale3d(0.8, 0.5, 1);
transform: scale3d(0.8, 0.5, 1);
}
.shoplinkamazon a:hover::before, .shoplinkrakuten a:hover::before, .shoplinkkindle a:hover::before, .shoplinkkakakucom a:hover::before, .shoplinkrakukobo a:hover::before, .shoplinkyahoo a:hover::before, .shoplinkseven a:hover::before, .shoplinkjtb a:hover::before, .shoplinkjalan a:hover::before {
-webkit-animation: anim-2 0.3s 0.3s forwards;
animation: anim-2 0.3s 0.3s forwards;
}
@-webkit-keyframes anim-1 {
60% {
-webkit-transform: scale3d(0.8, 0.8, 1);
transform: scale3d(0.8, 0.8, 1);
}
85% {
-webkit-transform: scale3d(1.1, 1.1, 1);
transform: scale3d(1.1, 1.1, 1);
}
100% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes anim-1 {
60% {
-webkit-transform: scale3d(0.8, 0.8, 1);
transform: scale3d(0.8, 0.8, 1);
}
85% {
-webkit-transform: scale3d(1.1, 1.1, 1);
transform: scale3d(1.1, 1.1, 1);
}
100% {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@-webkit-keyframes anim-2 {
to {
opacity: 0;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes anim-2 {
to {
opacity: 0;
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
.booklink-footer {
display: none;
}
@media screen and (max-width: 1024px) {
.kaerebalink-link1 a, .booklink-link2 a, .tomarebalink-link1 a { /*購入ボタン*/
width:calc(100% - 4px);
-moz-border-radius:5px;
-webkit-border-radius:5px;
border-radius:5px;
margin: 2px 0px;
padding:10px 0px;
}
}
@media screen and (max-width: 680px) {
.booklink-box, .kaerebalink-box, .tomarebalink-box{padding:15px;}
.booklink-image, .kaerebalink-image, .tomarebalink-image {
width: 100%;
min-width: initial;
display: block;
float: none;
}
.booklink-name > a, .kaerebalink-name > a, .tomarebalink-name > a{
font-size: 15px;
font-weight: bold;
}
.booklink-name, .kaerebalink-name, .tomarebalink-name{margin-bottom:12px;}
.booklink-powered-date, .kaerebalink-powered-date, .tomarebalink-powered-date{margin-top:5px;}
}

 

モバイル用css

 

子テーマの「mobile.css」に記述します。

 

 

カエレバ・ヨメレバ(モバイル)

/*モバイル用。カエレバ・ヨメレバ*/
.booklink-box, .kaerebalink-box{
    width:85%;
    margin: 1em 0 1em;
    padding: 5%;
    border:double #d2d7e6;
    overflow: hidden;
    font-size:small;
    border-radius:2px;
}
 
.booklink-image, .kaerebalink-image{
    float: none !important;
    text-align:center !important;
    margin:0 auto !important;
}
.booklink-image img, .kaerebalink-image img{
    display:block;
    margin:0 auto;
}
 
.booklink-info, .kaerebalink-info{
    text-align:center;
    line-height:120%;
    overflow: hidden;
    clear:left;
}
 
.booklink-name, .kaerebalink-name{
    font-size:16px;
    margin-bottom:14px;
    line-height:1.2em;
}
 
.booklink-powered-date, .kaerebalink-powered-date{
    font-size:8pt;
    margin-top:10px;
    line-height:120%;
}
.booklink-powered-date, .kaerebalink-detail{
    margin-bottom:15px;
}
 
.booklink-link2, .kaerebalink-link1{
    margin-top:20px;
}
 
.shoplinkamazon, .shoplinkrakuten, .shoplinkkindle, .shoplinkyahoo, .shoplinkkakakucom{
    width:99%;
    text-align:center;
    height:15px;
    overflow:hidden;
    background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%);
    background-color:#ffffff;
    border-radius:6px;
    border:2px solid #dcdcdc;
    display:inline-block;
    margin:0  auto 5px auto;
    padding:10px 0px;
    }
     
.shoplinkamazon:hover, .shoplinkrakuten:hover, .shoplinkkindle:hover, .shoplinkyahoo:hover{
    background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%);
    background-color:#f6f6f6;
}
 
.shoplinkamazon:active, .shoplinkrakuten:active, .shoplinkkindle:active, .shoplinkyahoo:active{
    position:relative;
    top:1px;
}
 
.shoplinkamazon a, .shoplinkrakuten a, .shoplinkyahoo a, .shoplinkkindle a, .shoplinkkakakucom a{
    display:block;
    cursor:pointer;
    text-decoration:none;
    font-weight:800;
    text-shadow:1px 1px 1px #dcdcdc;
    font-size:12px;
}
     
.shoplinkamazon a{
    color:#FF9901;
}
 
 .shoplinkrakuten a{
    color:#c20004;
}
 
.shoplinkkindle a{
    color:#007dcd;  
}
 
.shoplinkyahoo a{
    color:#7b0099;
 } 
 
.booklink-footer{
    clear:left;
}

トマレバ(モバイル)

/*モバイル用トマレバ*/
@media only screen and (max-width: 480px) {
.tomarebalink-box {
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 1px 1px 3px 1px #ddd;
  padding: 10px 15px;
}
.tomarebalink-image {
  margin: 0 0 10px 0;
  float: none;
}
.tomarebalink-image img {
  margin: 0 auto;
  display: block;
}
.tomarebalink-info {
  font-size: 12px;
  margin: 0;
}
.tomarebalink-name {
  font-size: 15px;
  margin-top: 2px;
}
.tomarebalink-detail {
  margin-top: 5px;
}
.tomarebalink-powered-date {
  font-size: 11px;
  margin-top: 5px;
}
.tomarebalink-link1 {
  font-size: 14px;
}
.shoplinkrakuten, .shoplinkjalan, .shoplinkjtb, .shoplinkikyu, .shoplinkrurubu {
  float: none;
  width: 100%;
  margin: 10px 0;
  padding: 5px 0;
 }
}