要将div的外边距设置为:“上边距:10px、下边距:10px、左边距:40px、右边距:40px”,正确的CSS语句是( )。
- A.margin:10px 10px 40px 10px
- B.padding:10px 40px 10px 40px
- C.margin:10px 40px
- D.margin-top:20px 30px 40px 50px
正确答案及解析
正确答案
解析
本题考查CSS盒子基本属性。
设置外边距的最简单的方法就是使用margin属性;h1{margin:10px 40px 10px 40px;}这些值的顺序是从上外边距(top)开始围着元素顺时针旋转的。可简写为h1{margin:10px 40px;}代表上外边距和下外边距为10px,右外边距和左外边距为40px。
综合分析,A选项顺序错误,应该为上右下左的顺序,B、D表示错误,B表示内边距,D表示上外边距。
CSS边距属性
1)包含4个值的时候,如10px、20px、30px、40px,分别代表的是上边距10px、右边距20px、下边距30px、左边距40px(顺序:上右下左)
2)包含3个值的时候,如10px、15px、20px,分别代表上边距10px、左右边距15px、下边距20px
3)包含2个值的时候,如10px、20px,分别代表上下边距10px,左右边距20px
4)包含1个值的时候,如10px,代表上下左右四个边距都为10px
包含此试题的试卷
你可能感兴趣的试题
Advancements in ( )have contributed to the growth of the automotive industry through the creation and evolution of self-driving vehicles.
-
- A.Artificial Intelligence
- B.Cloud Computing
- C.Internet of Things
- D.Big Data
- 查看答案
In project human resource management , ( )is not a source of power for the project manager.
-
- A.referent power
- B.expert power
- C.reward power
- D.audit power
- 查看答案
At the project establishment stage , the feasibility study mainly includes techinical feasibility analysis , ( ), operation environment feasibility analysis and other aspects of feasibility analysis.
-
- A.detail feasibility analysis
- B.opportunity analysis
- C.economic feasibility analysis
- D.risk analysis
- 查看答案
( )is a grid that shows the project resources assigned to each work package.
-
- A.Stakeholder engagement assessment matrix
- B.Requirements traceability matrix
- C.Probability and impact matrix
- D.Responsibility assignment matrix
- 查看答案
Xinhua News Agency reported in January 2022,Chian will further promote the developmet of a digital economy during the 14th Five-Year Plan eriod(2021-2025). The plan also emphasized industrial ( )transformation.
-
- A.digital
- B.networking
- C.intelligentize
- D.informatization
- 查看答案