Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
格式化CSS内容图像_Css - Fatal编程技术网

格式化CSS内容图像

格式化CSS内容图像,css,Css,我希望通过CSScontent属性垂直居中添加的图像 为什么要通过内容添加元素?为什么不使用背景图像?为什么不将其作为背景图像?查看下面的示例代码,定位由最后两部分处理 #bar { background: url(http://goo.gl/XWguD) no-repeat right 50%; padding: 3px 40px 3px 0; } :after不受支持

我希望通过CSS
content
属性垂直居中添加的图像

为什么要通过内容添加元素?为什么不使用背景图像?

为什么不将其作为背景图像?查看下面的示例代码,定位由最后两部分处理

#bar {
  background: url(http://goo.gl/XWguD) no-repeat right 50%;
  padding: 3px 40px 3px 0;         
}
:after不受支持

设置垂直对齐:sub;在#foo::after@SvenBieder-那不管用。对我来说它管用,但当你使用ie时,你必须设置一个doctype才能让它工作