HTML

<div class="container">
  <h3 class="title">
    <span>《企業贊助》</span>
  </h3>
</div>

CSS
/標題左右橫線/
.container {
width: 100%;
margin: auto;
}
.title {
color: #ffaa22;
font-size: 1.2rem;
margin-bottom: 1.5em;
text-align: center;
font-weight: 600;
line-height: 1.3;
}
.title span {
display: block;
font-family: 微軟正黑體;
font-size: 1.2rem;
color: #B3A619;
position: relative;
}
@media screen and (max-width: 400px) {
.title span:before, .title span:after {
content: “”;
position: absolute;
top: 50%;
background: #B3A619;
width: 23%;
height: 1px;
}
}
@media screen and (min-width: 400px) and (max-width: 768px) {
.title span:before, .title span:after {
content: “”;
position: absolute;
top: 50%;
background: #B3A619;
width: 32%;
height: 1px;
}
}
@media screen and (min-width: 768px) {
.title span:before, .title span:after {
content: “”;
position: absolute;
top: 50%;
background: #B3A619;
width: 38%;
height: 1px;
}
}
.title span:before {
left: 2%;
}
.title span:after {
right: 2%;
}

線上演示

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

Copyright © 2019 lcmstan.net. All Rights Reserved. 本站使用網易  虛擬主機