<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CSS &#8211; 编程技术记录</title>
	<atom:link href="https://blog.z6z8.cn/category/%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0/css/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.z6z8.cn</link>
	<description>世界你好!</description>
	<lastBuildDate>Tue, 17 Jan 2023 01:57:01 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>
	<item>
		<title>iOS WKWebView 播放视频时禁用自动全屏播放</title>
		<link>https://blog.z6z8.cn/2021/11/08/ios-wkwebview-%e6%92%ad%e6%94%be%e8%a7%86%e9%a2%91%e6%97%b6%e7%a6%81%e7%94%a8%e8%87%aa%e5%8a%a8%e5%85%a8%e5%b1%8f%e6%92%ad%e6%94%be/</link>
		
		<dc:creator><![CDATA[holdsky]]></dc:creator>
		<pubDate>Mon, 08 Nov 2021 03:37:58 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[学习笔记]]></category>
		<guid isPermaLink="false">http://blog.z6z8.cn/?p=1130</guid>

					<description><![CDATA[关键属性webkit-playsinline、playsinline、allowsInlineMediaPla [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>关键属性<code>webkit-playsinline</code>、<code>playsinline</code>、<code>allowsInlineMediaPlayback</code></p>
<p>需要在html style里面和native 里面同时设置才有效</p>
<p>html video增加样式<code> webkit-playsinline</code>、<code>playsinline</code></p>
<pre><code class="language-html"> &lt;video controls=&quot;&quot; height=&quot;auto&quot; id=&quot;video1&quot; playsinline=&quot;true&quot; preload=&quot;auto&quot; webkit-playsinline=&quot;true&quot; width=&quot;100%&quot;&gt;&lt;source src=&quot;xxxxx.mp4&quot; type=&quot;video/mp4&quot;&gt;
    您的浏览器不支持 HTML5 video 标签。
 &lt;/source&gt;&lt;/video&gt;</code></pre>
<p>native code 设置<code>allowsInlineMediaPlayback</code></p>
<pre><code class="language-objc">WKWebViewConfiguration *config = [[WKWebViewConfiguration alloc] init];
config.allowsInlineMediaPlayback = YES;
WKWebView *webView = [[WKWebView alloc]initWithFrame:CGRectZero configuration:config];</code></pre>
<p>参考 <a href="https://www.zhihu.com/question/21094425">https://www.zhihu.com/question/21094425</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>学习笔记：（转）CSS样式选择器优先级</title>
		<link>https://blog.z6z8.cn/2020/09/30/%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%9a%ef%bc%88%e8%bd%ac%ef%bc%89css%e6%a0%b7%e5%bc%8f%e9%80%89%e6%8b%a9%e5%99%a8%e4%bc%98%e5%85%88%e7%ba%a7/</link>
		
		<dc:creator><![CDATA[holdsky]]></dc:creator>
		<pubDate>Wed, 30 Sep 2020 08:19:40 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[学习笔记]]></category>
		<guid isPermaLink="false">http://blog.z6z8.cn/?p=900</guid>

					<description><![CDATA[CSS 7 种基础的选择器： ID 选择器， 如 #id{} 类选择器， 如 .class{} 属性选择器，  [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>CSS 7 种基础的选择器：</p>
<p>ID 选择器， 如 #id{}</p>
<p>类选择器， 如 .class{}</p>
<p>属性选择器， 如 a[href=&quot;segmentfault.com&quot;]{}</p>
<p>伪类选择器， 如 :hover{}</p>
<p>伪元素选择器， 如 ::before{}</p>
<p>标签选择器， 如 span{}</p>
<p>通配选择器， 如 *{}</p>
<p>CSS 优先规则3：优先级关系：内联样式 &gt; ID 选择器 &gt; 类选择器 = 属性选择器 = 伪类选择器 &gt; 标签选择器 = 伪元素选择器</p>
<p>参考 <a href="https://www.runoob.com/w3cnote/css-style-priority.html">https://www.runoob.com/w3cnote/css-style-priority.html</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>小程序同层渲染&#8211;iOS WKWebView实现</title>
		<link>https://blog.z6z8.cn/2020/01/13/%e5%b0%8f%e7%a8%8b%e5%ba%8f%e5%90%8c%e5%b1%82%e6%b8%b2%e6%9f%93-ios-wkwebview%e5%ae%9e%e7%8e%b0/</link>
		
		<dc:creator><![CDATA[holdsky]]></dc:creator>
		<pubDate>Mon, 13 Jan 2020 08:18:33 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Objective-C]]></category>
		<category><![CDATA[代码片段]]></category>
		<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[布局]]></category>
		<guid isPermaLink="false">http://blog.z6z8.cn/?p=769</guid>

					<description><![CDATA[先上代码 RenderWebViewWithNative 我只在模拟器环境中测了。 本文成文使用的环境 Xco [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>先上代码<br />
<a href="/wp-content/uploads/2020/01/RenderWebViewWithNative-1.zip" title="RenderWebViewWithNative">RenderWebViewWithNative</a><br />
我只在模拟器环境中测了。</p>
<p><img decoding="async" src="/wp-content/uploads/2020/01/RenderWebViewWithNative.png" alt="" /></p>
<h1>本文成文使用的环境</h1>
<ul>
<li>Xcode Version 11.3 (11C29)</li>
<li>模拟器版本Version 11.3 (SimulatorApp-912.5 SimulatorKit-570.3 CoreSimulator-681.17)，对应iOS 13.2</li>
</ul>
<h1>同层渲染步骤</h1>
<p>简单说下同层渲染效果，是将Native控件添加到WKWebView的子层级View中，最明显的是z-index 属性可以控制Native控件。详细请阅读https://developers.weixin.qq.com/community/develop/article/doc/000c4e433707c072c1793e56f5c813</p>
<h2>需要前端改造的地方</h2>
<p>为了让WKWebView为Native控件单独生成一个子层级的View，需要改变对应DOM节点的CSS样式,如</p>
<pre><code class="language-html">〈div style="position: fixed; font-size: 50px;overflow: scroll;-webkit-overflow-scrolling: touch" id="zl_native" 〉
            〈zl-native id="zl_native_node"〉world〈zl-native〉
〈/div〉</code></pre>
<p>本文成文环境中测试的结果是:</p>
<ul>
<li>WKWebView只为<code>position: fixed</code>的
<div>标签内容生成单独的子层级视图</li>
<li><code>overflow: scroll;-webkit-overflow-scrolling: touch</code>,在本文成文环境中不起作用；建议读者自行尝试更多的环境，以得到更准确的结论。</li>
</ul>
<h2>需要客户端改造的地方</h2>
<p>首先，当前端加载DOM时，检测到需要Native渲染的节点，需要通过jsbridge通知客户端，把节点的信息告诉客户端。客户端根据节点信息找到对应的子层级view</p>
<pre><code class="language-objc">-(UIView *)find_zl_native_view
{
    UIView *wkcontentview = [self get_wkcontentView];
    NSMutableArray *arr = [wkcontentview.subviews mutableCopy];
    while (arr.count > 0)
    {
        UIView *comp = arr.firstObject;
        [arr removeObjectAtIndex:0];
        if ([@"WKCompositingView" isEqualToString:NSStringFromClass([comp class])])
        {
            if ([comp.layer.name isEqualToString:@" <div> id='zl_native'"]) {
                return comp;
            }
        }

        if (comp.subviews.count > 0)
        {
            [arr addObjectsFromArray:comp.subviews];
        }
    }
    return nil;
}</code></pre>
<p>找到后，在这个子层级view上添加Native控件，渲染对应内容。</p>
<pre><code class="language-objc">-(void)startNativeRender_zl_native_node
{
    UIView *view = [self find_zl_native_view];
    UILabel *lbl = [[UILabel alloc] initWithFrame:view.bounds];
    [view addSubview:lbl];
    lbl.alpha = 0;
    [UIView animateWithDuration:3 animations:^{
        lbl.alpha = 0.6;
        lbl.text = @"world";
        lbl.textColor = [UIColor yellowColor];
        lbl.backgroundColor = [UIColor redColor];
        lbl.font = [UIFont systemFontOfSize:49.5];
    }];
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>学习笔记：CSS指定超链接的文字颜色</title>
		<link>https://blog.z6z8.cn/2019/10/11/%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%9acss%e6%8c%87%e5%ae%9a%e8%b6%85%e9%93%be%e6%8e%a5%e7%9a%84%e6%96%87%e5%ad%97%e9%a2%9c%e8%89%b2/</link>
		
		<dc:creator><![CDATA[holdsky]]></dc:creator>
		<pubDate>Fri, 11 Oct 2019 03:32:10 +0000</pubDate>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[学习笔记]]></category>
		<guid isPermaLink="false">http://blog.z6z8.cn/?p=480</guid>

					<description><![CDATA[超链接的四种状态 一个超链接示例 &#60;a href="https://www.z6z8.cn"&#62;z6 [&#8230;]]]></description>
										<content:encoded><![CDATA[<h1>超链接的四种状态</h1>
<p>一个超链接示例</p>
<pre><code class="language-html">&lt;a href="https://www.z6z8.cn"&gt;z6z8&lt;/a&gt;</code></pre>
<p>有四种状态：</p>
<ul>
<li>a:link - 普通的、未被访问的链接</li>
<li>a:visited - 用户已访问的链接</li>
<li>a:hover - 鼠标指针位于链接的上方</li>
<li>a:active - 链接被点击的时刻</li>
</ul>
<h1>CSS 改变超链接颜色</h1>
<p>在未指定适用范围时，下面css影响全局</p>
<pre><code class="language-css">a:link {
  /*前景色*/
  color:blue;
  /*背景色*/
  background-color: orange;
}

a:visited {
  color:red;
}

a:hover{
...
}
a:active{
...
}</code></pre>
<h1>CSS 改变部分超链接颜色</h1>
<p>需要将新颜色设置指定给具体的CSS块，例如</p>
<pre><code class="language-css">.testcss  {
    width:100%;
    height:20%;
}

.testcss  a:visited {
  color:red;
}</code></pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
