<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>拾光 - html</title>
<link>https://www.ishiguang.cn/tag/html/</link>
<atom:link href="https://www.ishiguang.cn/feed/tag/html/" rel="self" type="application/rss+xml" />
<language>zh-CN</language>
<description></description>
<lastBuildDate>Fri, 05 May 2023 07:52:03 +0800</lastBuildDate>
<pubDate>Fri, 05 May 2023 07:52:03 +0800</pubDate>
<item>
<title>瀑布流的样式-例子</title>
<link>https://www.ishiguang.cn/18614.html</link>
<guid>https://www.ishiguang.cn/18614.html</guid>
<pubDate>Fri, 05 May 2023 07:52:03 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[以下是一个基本的瀑布流布局的 CSS 样式：.masonry {    column-count: 3; /* 列数 */    column-gap: 20px; /* 列之间的间距 */}....]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>以下是一个基本的瀑布流布局的 CSS 样式：</p><pre><code class="lang-css">.masonry {
    column-count: 3; /* 列数 */
    column-gap: 20px; /* 列之间的间距 */
}

.masonry .item {
    margin-bottom: 20px; /* 元素之间的垂直间距 */
    display: inline-block;
    width: 100%;
}

/* 根据实际图片大小调整瀑布流元素的高度 */
.masonry .item img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .masonry {
        column-count: 2;
    }
}</code></pre><p>以上 CSS 样式将元素放置在多列中，可以自动布局，使得整个布局更加美观。其中 column-count 属性设置列数，column-gap 属性设置列之间的间距。另外，通过 @media 样式实现在小屏幕下响应式布局，将列数适当调整。</p><p>在 HTML 中，可以将元素以 .item 的类名包裹，然后将所有的 .item 放在 .masonry 容器中，如下所示：</p><pre><code class="lang-html">&lt;div class=&quot;masonry&quot;&gt;
  &lt;div class=&quot;item&quot;&gt;
    &lt;img src=&quot;image1.jpg&quot; alt=&quot;&quot;&gt;
    &lt;p&gt;这里是图片描述&lt;/p&gt;
  &lt;/div&gt;
  &lt;div class=&quot;item&quot;&gt;
    &lt;img src=&quot;image2.jpg&quot; alt=&quot;&quot;&gt;
    &lt;p&gt;这里是图片描述&lt;/p&gt;
  &lt;/div&gt;
  &lt;!-- 其他元素... --&gt;
&lt;/div&gt;</code></pre><p>请注意，瀑布流布局对浏览器的支持不够全面，可能需要使用浏览器前缀或 JavaScript 插件来实现兼容。</p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://www.ishiguang.cn/18614.html#comments</comments>
<wfw:commentRss>https://www.ishiguang.cn/feed/tag/html/</wfw:commentRss>
</item>
<item>
<title>雪花飘落特效</title>
<link>https://www.ishiguang.cn/16531.html</link>
<guid>https://www.ishiguang.cn/16531.html</guid>
<pubDate>Tue, 30 Aug 2022 17:06:00 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[雪花飘落特效只需要简单加载一个JS 不需要复杂的去加载CSS。或者别的直接上代码  把这个放进头部就可以了  /// &lt;reference path=&quot;jquery-1.10.2...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>雪花飘落特效</p><p>只需要简单加载一个JS 不需要复杂的去加载CSS。或者别的</p><p>直接上代码  把这个放进头部就可以了</p><pre><code>  /// &lt;reference path=&quot;jquery-1.10.2.min.js&quot; /&gt;
  ///
  ///
  var minSize = 5;
  var maxSize = 20;
  var newOn = 280;
  var flake = $(&quot;&lt;div&gt;&lt;/div&gt;&quot;).css({ &quot;position&quot;: &quot;absolute&quot;, &quot;top&quot;: &quot;-50px&quot; }).html(&quot;❅&quot;);
  $(function () {


    var documentHeight = $(document).height();
    var documentWidth = $(document).width();
    setInterval(function () {
    var startPositionLeft = Math.random() * documentWidth;
    var sizeFlake = minSize + Math.random() * maxSize;
    var endPositionLeft = Math.random() * documentWidth;
    var durationFall = documentHeight * 15 + Math.random() * 3000;
    var startOpacity = 0.7 + 0.3 * Math.random();
    var endOpacity = 1.5 * Math.random();
    flake.clone().appendTo($(&quot;body&quot;)).css({
        &quot;left&quot;: startPositionLeft,
        &quot;opacity&quot;: startOpacity,
        &quot;font-size&quot;: sizeFlake,
        &quot;color&quot;: &quot;#aadff1&quot;
    }).animate({
        &quot;top&quot;: documentHeight - 40,
        &quot;left&quot;: endPositionLeft,
        &quot;opacity&quot;: endOpacity
    }, durationFall, function () {
        $(this).remove();
    });
    }, newOn);
    });
</code></pre><p>记得加载jquery  如果有加载就不需要再加载了！</p><p>效果如下</p><p><img src="https://up.ishiguang.cn/blog/typecho/84207-ves0q3oofq8_20220830050607.png?imageMogr2/format/webp" alt="84207-ves0q3oofq8_20220830050607.png" title="84207-ves0q3oofq8_20220830050607.png"></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://www.ishiguang.cn/16531.html#comments</comments>
<wfw:commentRss>https://www.ishiguang.cn/feed/tag/html/</wfw:commentRss>
</item>
<item>
<title>html分割线代码</title>
<link>https://www.ishiguang.cn/15842.html</link>
<guid>https://www.ishiguang.cn/15842.html</guid>
<pubDate>Tue, 01 Mar 2022 14:27:48 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[1、两头渐变透明：!!!       &lt;HR style= &quot; FILTER: alpha (opacity = 100, finishopacity =0 , style= 3...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<pre><code>       1、两头渐变透明：</code></pre><p>!!!</p><pre><code>       &lt;HR style= &quot; FILTER: alpha (opacity = 100, finishopacity =0 , style= 3 )&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 3&gt;</code></pre><p>!!!</p><pre><code class="lang-html">&lt;HR style= &quot; FILTER: alpha (opacity = 100, finishopacity =0 , style= 3 )&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 3&gt;</code></pre><pre><code>       2、纺锤形：</code></pre><p>!!!</p><pre><code>       &lt;HR style= &quot; FILTER: alpha (opacity = 100, finishopacity =0 , style= 2 )&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 10&gt;</code></pre><p>!!!</p><pre><code class="lang-html">&lt;HR style= &quot; FILTER: alpha (opacity = 100, finishopacity =0 , style= 2 )&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 10&gt;</code></pre><pre><code>       3、右边渐变透明：</code></pre><p>!!!</p><pre><code>       &lt;HR style= &quot; FILTER: alpha (opacity = 100, finishopacity =0 , style= 1 )&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 3&gt;</code></pre><p>!!!</p><pre><code class="lang-html">&lt;HR style= &quot; FILTER: alpha (opacity = 100, finishopacity =0 , style= 1 )&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 3&gt;</code></pre><pre><code>       4、左边渐变透明：</code></pre><p>!!!</p><pre><code>       &lt;HR style= &quot; FILTER: alpha (opacity = 0, finishopacity =100 , style= 1 )&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 3&gt;</code></pre><p>!!!</p><pre><code class="lang-html">&lt;HR style= &quot; FILTER: alpha (opacity = 0, finishopacity =100 , style= 1 )&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 3&gt;</code></pre><pre><code>       5、虚线：</code></pre><p>!!!</p><pre><code>       &lt;HR style= &quot; border: 1 dashed #987cb9&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 1&gt;</code></pre><p>!!!</p><pre><code class="lang-html">&lt;HR style= &quot; border: 1 dashed #987cb9&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 1&gt;</code></pre><pre><code>       6、双线：</code></pre><p>!!!</p><pre><code>       &lt;HR style= &quot; border: 3 double #987cb9&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 3&gt;</code></pre><p>!!!</p><pre><code class="lang-html">&lt;HR style= &quot; border: 3 double #987cb9&quot; width =&quot;80%&quot; color =#987 cb 9 SIZE = 3&gt;</code></pre><pre><code>       7、立体效果：</code></pre><p>!!!</p><pre><code>       &lt;HR style= &quot; FILTER: progid:DXImageTransform.Microsoft.Shadow ( color: #987cb9 ,direction : 145, strength :15 ) &quot; width = &quot;80%&quot; color = #987cb 9 SIZE= 1&gt;</code></pre><p>!!!</p><pre><code class="lang-html">&lt;HR style= &quot; FILTER: progid:DXImageTransform.Microsoft.Shadow ( color: #987cb9 ,direction : 145, strength :15 ) &quot; width = &quot;80%&quot; color = #987cb 9 SIZE= 1&gt;</code></pre><pre><code>       8、钢针效果：</code></pre><p>!!!</p><pre><code>       &lt;HR style= &quot; FILTER: progid:DXImageTransform.Microsoft.Glow ( color= #987cb9 ,strength = 10) &quot; width= &quot;80%&quot; color= #987 cb9 SIZE =1&gt;</code></pre><p>!!!</p><pre><code class="lang-html">&lt;HR style= &quot; FILTER: progid:DXImageTransform.Microsoft.Glow ( color= #987cb9 ,strength = 10) &quot; width= &quot;80%&quot; color= #987 cb9 SIZE =1&gt;</code></pre><pre><code>       ９．垂直分割线</code></pre><p>!!!</p><pre><code>       &lt;table border= &quot;1px&quot; cellpadding= &quot;0&quot; cellspacing= &quot;0&quot; style =&quot; margin-left :200 px ;height : 265px ; border-left-style: solid ; border-bottom-style : none; border-right-style :none ; border-top-style: none &quot;&gt;</code></pre><p>!!!</p><pre><code class="lang-html"> &lt;table border= &quot;1px&quot; cellpadding= &quot;0&quot; cellspacing= &quot;0&quot; style =&quot; margin-left :200 px ;height : 265px ; border-left-style: solid ; border-bottom-style : none; border-right-style :none ; border-top-style: none &quot;&gt;</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://www.ishiguang.cn/15842.html#comments</comments>
<wfw:commentRss>https://www.ishiguang.cn/feed/tag/html/</wfw:commentRss>
</item>
<item>
<title>HTML中引入CSS 的方式</title>
<link>https://www.ishiguang.cn/12211.html</link>
<guid>https://www.ishiguang.cn/12211.html</guid>
<pubDate>Sat, 22 Jan 2022 21:41:00 +0800</pubDate>
<dc:creator>admin</dc:creator>
<description><![CDATA[有 4 种方式可以在 HTML 中引入 CSS。其中有 2 种方式是在 HTML 文件中直接添加 CSS 代码，另外两种是引入 外部 CSS 文件。下面我们就来看看这些方式和它们的优缺点。内联方...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>有 4 种方式可以在 HTML 中引入 CSS。其中有 2 种方式是在 HTML 文件中直接添加 CSS 代码，另外两种是引入 外部 CSS 文件。下面我们就来看看这些方式和它们的优缺点。</p><p>内联方式</p><p>内联方式指的是直接在 HTML 标签中的 style 属性中添加 CSS。</p><p>示例：</p><pre><code class="lang-html">&lt;div style=&quot;background: red&quot;&gt;&lt;/div&gt;</code></pre><p>这通常是个很糟糕的书写方式，它只能改变当前标签的样式，如果想要多个 <div> 拥有相同的样式，你不得不重复地为每个 <div> 添加相同的样式，如果想要修改一种样式，又不得不修改所有的 style 中的代码。很显然，内联方式引入 CSS 代码会导致 HTML 代码变得冗长，且使得网页难以维护。</p><p>嵌入方式</p><p>嵌入方式指的是在 HTML 头部中的 <style> 标签下书写 CSS 代码。</p><p>示例：</p><pre><code class="lang-html">&lt;head&gt; &lt;style&gt; .content { background: red; } &lt;/style&gt;&lt;/head&gt;</code></pre><p>嵌入方式的 CSS 只对当前的网页有效。因为 CSS 代码是在 HTML 文件中，所以会使得代码比较集中，当我们写模板网页时这通常比较有利。因为查看模板代码的人可以一目了然地查看 HTML 结构和 CSS 样式。因为嵌入的 CSS 只对当前页面有效，所以当多个页面需要引入相同的 CSS 代码时，这样写会导致代码冗余，也不利于维护。</p><p>链接方式</p><p>链接方式指的是使用 HTML 头部的 <head> 标签引入外部的 CSS 文件。</p><p>示例：</p><pre><code class="lang-html">&lt;head&gt; &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;style.css&quot;&gt;&lt;/head&gt;</code></pre><p>这是最常见的也是最推荐的引入 CSS 的方式。使用这种方式，所有的 CSS 代码只存在于单独的 CSS 文件中，所以具有良好的可维护性。并且所有的 CSS 代码只存在于 CSS 文件中，CSS 文件会在第一次加载时引入，以后切换页面时只需加载 HTML 文件即可。</p><p>导入方式</p><p>导入方式指的是使用 CSS 规则引入外部 CSS 文件。</p><p>示例：</p><pre><code class="lang-html">&lt;style&gt; @import url(style.css);&lt;/style&gt;</code></pre><p>比较链接方式和导入方式</p><p>链接方式（下面用 link 代替）和导入方式（下面用 @import 代替）都是引入外部的 CSS 文件的方式，下面我们来比较这两种方式，并且说明为什么不推荐使用 @import。</p><p>link 属于 HTML，通过 <link> 标签中的 href 属性来引入外部文件，而 @import 属于 CSS，所以导入语句应写在 CSS 中，要注意的是导入语句应写在样式表的开头，否则无法正确导入外部文件；<br>@import 是 CSS2.1 才出现的概念，所以如果浏览器版本较低，无法正确导入外部样式文件；<br>当 HTML 文件被加载时，link 引用的文件会同时被加载，而 @import 引用的文件则会等页面全部下载完毕再被加载；<br>小结：我们应尽量使用 <link> 标签导入外部 CSS 文件，避免或者少用使用其他三种方式。</p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://www.ishiguang.cn/12211.html#comments</comments>
<wfw:commentRss>https://www.ishiguang.cn/feed/tag/html/</wfw:commentRss>
</item>
</channel>
</rss>