JSFiddle - React, Tailwind, and code Playground
HTML
<div class="event_item weather_type event_open" >
<div class="event_title">
TEST
</div>
<a href="#"><img src="https://s.yimg.com/bf/tw/ysm/soeasy/pr/businessImg/aom20170526065_d.jpg?t=1510640562" alt="ERROR" class="event_item_pic" /></a>
<div class="event_text" >
<input name="like[]" style="position: relative;" type="checkbox" value="1">是否喜歡此廣告?
</div>
</div>
<div class="event_item weather_type event_open" >
<div class="event_title">
TEST
</div>
<a href="#"><img src="XXX" alt="ERROR" class="event_item_pic" /></a>
<div class="event_text" >
<input name="like[]" style="position: relative;" type="checkbox" value="1">是否喜歡此廣告?
</div>
</div>
CSS
.event_title {
font-size: 16px;
height: 30px;
color: green;
}
.event_item{ /*個別活動訊息項目*/
border: 1px solid rgb(175, 176, 176);
border-radius: 2px;
width: 200px;
float: left;
margin-left: 10px;
margin-bottom: 10px;/*RWD實行時可讓項目間留空*/
padding: 10px 10px 30px 10px;/*上右下左*/
background-color: rgb(255, 255, 255);
position: relative;/*因為預設的position為static,而static不能被absolute用來上層定位,故多個relative但又不影響原先的位置*/
font-family: SimHei,Microsoft YaHei;
}
.event_item .event_item_pic{
width: 180px;
height: 100px;
position: relative;
left: 50%;
margin-left: -90px;
padding-top: 10px;
padding-bottom: 10px;
border-bottom: 1px solid rgb(201, 15, 9);
}
.event_item .event_title{ /*個別活動訊息標題*/
text-align: center;
letter-spacing: 1px;
}
.event_item .event_text{ /*個別活動訊息圖片下的內文區*/
/*background-color: blue;*/
font-size: 13px;
line-height: 19px;
}
.event_item .event_text p{ /*個別活動訊息內文區小標題*/
color: green;
}
.event_item .event_text p span{ /*個別活動訊息內文*/
color: black;
font-size: 12px;
}
.event_item .event_content_button:hover{
top: 1px;
}