Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Week2 Hw2 Margin問題 #6

Open
AngeloETH opened this issue Jul 13, 2018 · 3 comments
Open

Week2 Hw2 Margin問題 #6

AngeloETH opened this issue Jul 13, 2018 · 3 comments

Comments

@AngeloETH
Copy link

AngeloETH commented Jul 13, 2018

在做week2 hw2時,每個

上面都有30的Margin,但在實作時:
main{ margin: 0; margin: 30px auto; width: 720px; font-size: 21px; text-align: justify; }
需要加入
margin: 0;
否則上面的Margin為font-size的21,看了一下範例的code也沒有
margin: 0;
請問一下是為什麼呢?

@aszx87410
Copy link
Member

你可能要附上 codepen 範例之類的喔,否則這樣光看看不太出問題在哪,照理來說 margin 應該會被後面那個規則蓋掉才對。

@AngeloETH
Copy link
Author

已解決!
感謝

@AngeloETH
Copy link
Author

我是將整段的p包起來成:
<dive id='main'></div>
這樣margin的時候只有整包的上方有margin: 30
所以改成
p{margin: 30px 0px; }
就代表每個p上面都要30px的margin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants