イメージされた背景にこれを置こうとしています。私はそれを半作業に持っていますが、何らかの理由で添付しません。それらを接続しようとする2つの要素として作るのは間違っていますか?それを1つの要素、あるいはより良い方法にする方法はありますか?CSSリボンを作るには?
ここで、それは今あるものです:
http://codepen.io/anon/pen/MJJJog
.wrapper {
text-align: center;
}
p {
font-family: arial;
font-weight: normal;
margin: 0;
padding: 0;
text-align: left;
}
.header__ribbon {
padding: 10px 20px;
background-color: #ad0304;
color: #fff;
width: 70%;
max-width: 350px;
text-transform: uppercase;
font-size: 24px;
display: inline-block;
vertical-align: middle;
}
.header__ribbon__point {
margin: 0;
width: 0;
height: 0;
border-top: 35px solid #ad0304;
;
border-right: 35px solid transparent;
border-bottom: 35px solid #ad0304;
;
display: inline-block;
vertical-align: middle;
border-left: 10px solid #ad0304;
}
.header__ribbon--secondaryText {
font-size: 16px;
}
<div class="wrapper">
<div class="header__ribbon">
<p>Complimentary Event -</p>
<p class="header__ribbon--secondaryText">
mark your calenders for <span class="text__B">march 1<sup>st</sup>!</span>
</p>
</div>
<div class="header__ribbon__point"></div>
</div>
http://codepen.io/anon/pen/egggrJ私はあなたがインラインブロックを使用しているとして、これらの要素間のスペースは、問題だと思う – Misiur
はい、空白を削除するか、親要素のfont-sizeを0に設定します。これらのインラインブロックdiv要素の間に説明できないギャップがあるのはなぜですか?(http://stackoverflow.com/questions/19038799/why-is-there-an-unexplainable-gap-between-these-inline-block- div要素) – Marvin