小编use*_*882的帖子

在悬停时更改图像和文本,然后单击

我有一个图像和文本与它一起,我希望在悬停或通过单击图像同时更改这两个.

我可以设法让图像和文本分开交换,但不能同时交换.

HTML

<body>
<div id="page-container">
    <div class="box-container">
        <div class="image-container">
            <a href="#"><img src=".jpg" height="100" width="200"/></a>
        </div>
        <div class="second-image-container">
            <a href="#"><img src=".jpg" height="100" width="200"/></a>
        </div>
        <div id="text">
            <div id="text-box">
                <p>This is some text</p>

                <p id="more-text">This is some more text</p>
            </div>
        </div>
        <div id="text-two">
            <div id="text-box-two">
                <p>This is some text</p>

                <p id="even-more-text">This is some more text</p>
            </div>
        </div>
    </div>
</div>
</div>
</div>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

CSS

div#text {
    position: absolute;
    background-color: black;
    width: 350px;
    height: 300px;
    top: 10px;
    right: -65px;
}

div#text p …
Run Code Online (Sandbox Code Playgroud)

html css image hover

1
推荐指数
1
解决办法
1万
查看次数

按钮上的隐藏和显示列表

我试图隐藏并显示某个列表.但它没有用.我正在使用jquery .toggle来获得此效果但由于某种原因列表项不会让步.真的需要对此进行解释以及为什么它不起作用.

CSS:

div#right-column-sidebar{position: absolute; top: 840px; right: -140px}

div#right-column-sidebar ol{position:absolute; right: 150px;margin:    
10px 0 10px 10px; font-size: 20px; color: red;list-style-type:none}

div#right-column-sidebar ol li {list-style-type:none;margin: 10px 0 10px 0; border-    
bottom: 1px dotted grey; width: 200px; display: block;}}

div#right-column-sidebar ol li a{font-size: 60%; color: blue;margin-left: 20px}
div#right-column-sidebar ol li:nth-child(11){margin-left:}      
div#right-column-sidebar ol li a:hover{text-decoration: underline;}

a.button {
    border: 1px solid lightgrey;no-repeat scroll top right;
    color: #444;
    display: block;
    float: left;
    font: normal 12px arial, sans-serif;
    height: 24px;
    margin-right: 6px;
    padding-right: …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery show-hide

0
推荐指数
1
解决办法
2905
查看次数

Java如何读取和删除文件的内容.

在将其添加到我的网页之前,我有一个列表,其中包含大约700个我需要编辑的项目.我尝试手动编辑每个项目,但它变得过于广泛,我认为我可能会使用Java来阅读和编辑文件,因为需要编辑的单词在每个项目中具有相同的开头和结尾.

我想我会先从Q中的单词循环开始,保存它,当我有逻辑工作时,我会找到如何阅读文本文件并再次做同样的事情.(如果有任何其他方法,我愿意接受建议)这是我到目前为止编写的代码,很久以前我用Java编写代码,所以我现在基本上没有技能.

import javax.swing.JOptionPane;

public class CustomizedList
{

public static void main (String[] args)
{
    String Ord = JOptionPane.showInputDialog("Enter a word");
    String resultatOrd ="";

    for(int i = 0; i < Ord.length(); i++)
    {
        if(Ord.charAt(i) == 'y' && Ord.charAt(i) == 'e' && Ord.charAt(i) ==    

's')
        {
            resultatOrd += Ord.charAt(i);
            System.out.println(resultatOrd);
        }   

        else
        System.out.println("Wrong word.");
    }
}
}
Run Code Online (Sandbox Code Playgroud)

我不确定我做错了什么,但我输入的这个词在逻辑上不起作用.我想从这个文本文件中删除两个单词:YES和NO,都是大写和小写.

java

0
推荐指数
1
解决办法
366
查看次数

标签 统计

css ×2

html ×2

hover ×1

image ×1

java ×1

javascript ×1

jquery ×1

show-hide ×1