Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.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
Ios 使用css*选择器将webkit uiview for iPhone中的所有内容都匹配是一个好主意吗?_Ios_Css_Uiview_Webkit - Fatal编程技术网

Ios 使用css*选择器将webkit uiview for iPhone中的所有内容都匹配是一个好主意吗?

Ios 使用css*选择器将webkit uiview for iPhone中的所有内容都匹配是一个好主意吗?,ios,css,uiview,webkit,Ios,Css,Uiview,Webkit,我正在制作一个RSS阅读器,为了在水平宽度内显示图像,我在HTML内容中添加了以下CSS代码: <html><style type='text/css'>* { max-width: 100%% !important; width: auto !important; height: auto !important; } </style><body>%@</body></html> * {最大宽度:100%!重要

我正在制作一个RSS阅读器,为了在水平宽度内显示图像,我在HTML内容中添加了以下CSS代码:

<html><style type='text/css'>* 
{ max-width: 100%%  !important; 
width: auto  !important; 
height: auto  !important; }
</style><body>%@</body></html>
*
{最大宽度:100%!重要;
宽度:自动!重要;
高度:自动!重要;}
%@
这是个好主意吗?使用*而不是img标记的原因是,当您在图像周围使用标题div(就像wordpress那样)时,图像超出了水平边界


当我读到这篇文章时,我首先想到的缺点是,*选择器有时会非常密集,因为它会选择所有元素

在手机上,这可能是一个问题


但除此之外,我认为使用它没有任何问题,这不是最佳实践,但它应该可以工作。

仅将其应用于img元素会有任何问题吗?@cimmanon我只将其应用于img标记。但是当图像在div中时(例如,wordpress标题),css选择器不起作用!谢谢,我正在iPhone应用程序上使用它,所以硬件方面我怀疑这是否会是个问题。有什么好的替代方法来捕捉所有图像吗?(即使是嵌套在div中的类)您也可以尝试选择所有类,然后将样式应用于它们。例如:#id1.class1{code;}问题是,我使用了几个不同的站点,不可能为每种情况都选择这样的类。