Skip to content

Instantly share code, notes, and snippets.

@cazuki
Created August 16, 2015 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cazuki/1432f5252d3cdd76f3f0 to your computer and use it in GitHub Desktop.
Save cazuki/1432f5252d3cdd76f3f0 to your computer and use it in GitHub Desktop.
WordPressでチャット風会話形式のコンテンツを表示するためのCSS
.balloon-box {
overflow: hidden;
margin: 0 0 0.8rem;
}
.balloon-box:last-of-type {
margin: 0 0 1.7rem;
}
.balloon-icon {
width: 90px;
text-align: center;
line-height: 1rem;
}
.balloon-icon img {
width: 90px;
height: auto;
}
.balloon-icon span {
position: absolute;
top: 0;
font-size: 11px;
overflow: hidden;
white-space: nowrap;
}
.balloon-left .balloon-icon {
position: relative;
float: left;
margin:0 -90px 0 0;
}
.balloon-left .balloon-serif {
position: relative;
float: left;
margin: 0 90px 0 110px;
padding: 10px 0 0;
}
.balloon-left .balloon-serif:before, .balloon-left .balloon-serif::before {
position: absolute;
content: "";
top: 20px; left: -10px;
width: 0; height: 0;
border-style: solid;
border-width: 10px 10px 0 0;
border-color: transparent #eeeeee transparent transparent;
z-index: 1;
}
.balloon-left .balloon-serif .balloon-content {
position: relative;
padding: 0.5rem 1rem;
line-height: 1.5rem;
background: #eeeeee;
border-radius: 6px;
z-index: 2;
}
.balloon-right .balloon-icon {
position: relative;
float: right;
margin: 0 0 0 -90px;
}
.balloon-right .balloon-serif {
position: relative;
float: right;
margin: 0 110px 0 90px;
padding: 10px 0 0;
}
.balloon-right .balloon-serif:before, .balloon-right .balloon-serif::before {
position: absolute;
content: "";
top: 20px; right: -10px;
width: 0; height: 0;
border-style: solid;
border-width: 10px 0 0 10px;
border-color: transparent transparent transparent #eeeeee;
z-index: 1;
}
.balloon-right .balloon-serif .balloon-content {
position: relative;
padding: 0.5rem 1rem;
line-height: 1.5rem;
background: #eeeeee;
border-radius:6px;
z-index:2;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment