day03 关于margin-top元素给不上解决方案及css样式

背景样式

  1. 背景颜色——background-color
  2. 背景图片——background-images
  3. 背景图片大小——background-size
  4. 背景重复——background-repeat
  5. 背景图片位置——background-position 水平位置 垂直位置;可以给负值
  6. 背景图片固定——background-attachment

边框样式

  1. Border-width
  2. border-style
  3. Border-color

列表样式

  1. 项目符号——list-style-type
  2. 列表项图片——list-style-image

字体

  1. Font-size 字体大小 单位px、pt......
  2. Color 颜色
  3. Font-family 字体样式
  4. Font-weight 加粗 bolder、bold...
  5. Font-style 倾斜 italic、oblique..
  6. Text-align 文本水平对齐 left、center、right、justify
  7. Line-height 行高 行高等于height可以设置字体垂直居中
  8. Text-decoration文本修饰 none没有、underline下划线、overline上划线、line-thought 删除线
  9. Text-indent 首行缩进 可以去负值 一般取2em 只对第一行起作用
  10. Letter-spacing 字间距 控制文字与文字之间的间距

两个div,一个嵌套一个,如果给子元素margin-top,那么子元素的margin-top的元素将会给到父元素上,遇到这种问题,需要给父元素overflow:hidden;或者给父元素border-top值,问题就会解决

猜你喜欢

转载自blog.csdn.net/Cat_LIKE_Mouse/article/details/118770355