简体   繁体   English

我想在我的HTML页面上打印图标

[英]I want to print the icons on my html page

In this code I linked some icons in to my html page. 在这段代码中,我将一些图标链接到了html页面。 I want to print them in my html page. 我想在我的html页面中打印它们。 How can I do it?. 我该怎么做?。 I don't get any sufficient answer on my searches so apologies if this is a duplicate. 我在搜索中没有得到足够的答案,因此如果重复,我们深表歉意。 in this link they have shown how to style icons loaded from internet using and tag,instead of internet i want to load from my computer using the same tags,can you help me? 在此链接中,他们展示了如何使用和标记从Internet加载的图标的样式,而不是我想使用相同的标记从我的计算机加载的Internet,可以帮助我吗?

<html>
    <head>
       <!-- <link rel="stylesheet" href="make.css">
        <link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png">-->
        <link rel="icon" type="image/png" href="icona.png" sizes="32x32" />
         <link rel="icon" type="image/png" href="iconb.png" sizes="32x32" />
         <link rel="icon" type="image/png" href="iconc.png" sizes="32x32" />
         <link rel="icon" type="image/png" href="icond.png" sizes="32x32" />
<link rel="icon" type="image/png" href="favicon-16x16.png" sizes="16x16" />
    </head>
    <body>

    </body>
</html>

for example here the <i> tag is used to load an icon. 例如,这里<i>标签用于加载图标。

<a id="fa-flag" href="javascript:;" onClick="$C.setIcon()">
  <i class="fa fa-flag"> </i>fa-flag
</a>

The link tags you are using are for setting the pages favicon icon (icon in the browser tab). 您正在使用的link标签用于设置页面收藏夹图标(浏览器选项卡中的图标)。

To add the image to the HTML page for rendering, you'd need to add an img tag within the document's body. 要将图像添加到HTML页面进行渲染,您需要在文档的正文中添加一个img标签。

<body>
   <img src="favicon-32x32.png" height="32" width="32" />
<body>

You cannot use link tag for displaying icons on your page. 您不能使用链接标记在页面上显示图标。 Its use is to load external stylesheets and setting icon of browser tab( favicon ). 它的用途是加载外部样式表并设置浏览器选项卡的图标(favicon)。 You can refer the following link for more details. 您可以参考以下链接以获取更多详细信息。

To display images you can do two things :- 要显示图像,您可以做两件事:

1) By an img tag :- 1)通过img标签:-

<body>
   <img src="icona.png" height="32" width="32" />
   <img src="iconb.png" height="32" width="32" />
   <img src="iconc.png" height="32" width="32" />
   <img src="icond.png" height="32" width="32" />
   <img src="favicon-16X16.png" height="16" width="16" />
<body>

2) By a div tag :- 2)通过div标签:-

html:- HTML: -

<body>
   <div class="image-icona" height="32" width="32"></div>
<body>

css:- CSS: -

.image-icona{
    width: 32px;
    height: 32px;
    background-image: url("../img/icona.png");
    background-repeat: no-repeat;
    background-size: contain;
}

IMG TAG IMG标签

You need to use img tag to display a picture in the webpage 您需要使用img标签在网页中显示图片

LINK TAG 链接标签

The tag is used for defining a link to an external document. 标签用于定义到外部文档的链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM