Last active
June 12, 2020 11:32
-
-
Save e96031413/c15eee06ba6fadb152d8d83676cafa9e to your computer and use it in GitHub Desktop.
使用Pug縮排語法撰寫HTML和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
<!-- | |
self closing elements:如meta標籤、img標籤,只要單行就可以結尾,不用縮排 | |
一般的elements:<div>、<style>需要</div>、</style>的,則需要縮排 | |
.google-review-img = <div class="google-review-img"></div> | |
可使用 https://pughtml.com/ 進行Pug to html語法轉換 | |
--> | |
meta(name='viewport', content='width=device-width, initial-scale=1') | |
.google-review-img | |
img(src='images/demo.jpg', alt='abc') | |
style. | |
.google-review-img { | |
background-color: #2693B0; | |
text-align: center; | |
display: block; | |
max-width: 100%; | |
width: 100% | |
} | |
@media screen and (max-width: 479px) { | |
.google-review-img img { | |
max-width: 300px; | |
} | |
} | |
.google-review-img | |
img(src='images/demo.jpg') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment