简体   繁体   English

<style> tag issue in WP widget

[英]<style> tag issue in WP widget

I'm trying to make a simple image link with :hover inside a WordPress widget which supports HTML Source Code. 我正在尝试在支持HTML源代码的WordPress小部件内使用:hover建立一个简单的图像链接。

Please fin my code: 请查找我的代码:

<style>
a.filtro{
width:100px;
background: url("http://www.tk.gvdgvd.net/wp-content/uploads/2014/04/tokooblog_filtro-02.png");
}

a.filtro:hover{
width:100px;
background: url('http://www.tk.gvdgvd.net/wp-content/uploads/2014/04/tokooblog_filtro_sel-02.png');
}
</style>

<a href="http://www.tk.gvdgvd.net/?cat=10" class="filtro"></a>

The link simply does not appear in the page now 该链接现在根本没有出现在页面中

I don't know what's wrong here, is it something that my widget does not support my css? 我不知道这里出了什么问题,我的小部件不支持CSS吗? Is all the "hover" css done right? 所有“悬停” css是否正确? maybe it's messed up too, but i can't find whats wrong with the code either. 也许也搞砸了,但是我也找不到代码有什么问题。

Thanks in advance! 提前致谢!

a {display:block; width:100px;height:auto;}

You should first copy the css code and paste in style.css, if it does work pasting in style.css then there must be porblem with widget area. 您应该首先复制css代码并粘贴到style.css中,如果它确实可以粘贴到style.css中,则必须在小部件区域存在问题。 There are couple of plugin available you can use that too. 有几个可用的插件,您也可以使用它。 for eg : 例如:
https://wordpress.org/plugins/tags/text-widget If this is doesn't work then try this one. https://wordpress.org/plugins/tags/text-widget如果这不起作用,请尝试使用此方法。 Alternate way is to check if you copy the same code in other wordpress and paste in widget I guess it will work. 另一种方法是检查您是否在其他wordpress中复制了相同的代码并将其粘贴到小部件中,我想它会起作用。

<style>
a.filtro{
width: 196px;
height: 196px;
display: block;
background: url("http://www.tk.gvdgvd.net/wp-content/uploads/2014/04/tokooblog_filtro-02.png");
}

a.filtro:hover{
background: url('http://www.tk.gvdgvd.net/wp-content/uploads/2014/04/tokooblog_filtro_sel-02.png');
}
</style>

<a href="http://www.tk.gvdgvd.net/?cat=10" class="filtro"></a>

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

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