子選擇器的問題
body ?#box1{margin-bottom:30px;}/*有效果*/
body div #box1{margin-bottom:30px;}/*沒效果*/
?#box1{margin-bottom:30px;}/*有效果*/
div #box1{margin-bottom:30px;}/*沒效果*/
為什么會這樣子?
body ?#box1{margin-bottom:30px;}/*有效果*/
body div #box1{margin-bottom:30px;}/*沒效果*/
?#box1{margin-bottom:30px;}/*有效果*/
div #box1{margin-bottom:30px;}/*沒效果*/
為什么會這樣子?
2016-01-27
舉報
2016-01-27
div #box1{{margin-bottom:30px;}/*div標簽和#box1是同一級標簽,不存在#box1是div的子標簽,所以凡是“div #box1”的寫法不生效*/
2016-04-20
div #box1{}這種寫法叫包含選擇器,div>#div{}這樣寫才叫子選擇器。