Last active
June 12, 2020 08:00
-
-
Save e96031413/10b1496aeda708da8b6d8ac29f74bd95 to your computer and use it in GitHub Desktop.
在html中針對一個小block自定義CSS效果
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
.google-review-img{ | |
background-color: #2693B0; | |
text-align: center; | |
display: block; | |
max-width:100%; | |
width:100%; | |
} | |
<!-- RWD功能:寬度小於479px的裝置,google-review-img class中的img標籤,圖片大小設定為300px --> | |
@media screen and (max-width: 479px) { | |
.google-review-img img { | |
max-width: 300px; | |
} | |
} | |
</style> | |
<div class="google-review-img"> | |
<img src="assets/images/placeholders/google-review.png" alt="Google Review"> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment