如何使表格单元格中溢出的div的css很重要?

时间:2016-11-11 06:41:09

标签: html css

我是css的新手。 我连续两个td,其中第一个溢出可见。第一个div中的内容与第二个td重叠,如下例所示。我希望将div css属性像cursor:指针放在第二个td上。因此,div css属性应该位于第二个td之上。 请帮我解决一下这个。

https://jsfiddle.net/jt00uk3e/

感谢。



table {
    width: 0px;
    table-layout: fixed;
}

td {
    width:50px;
    height:50px;
    overflow: visible;
}

#td1 {
    background-color: red;
}

#td2 {
    background-color: green;
}

#div2 {
    width: 200px;
    height: 20px;
    background-color: blue;
    cursor: pointer;
}

<table>
    <tr>
        <td id="td2"><div id="div2"></div></td>
        <td id="td1"></td>
    </tr>
</table>
&#13;
&#13;
&#13;

2 个答案:

答案 0 :(得分:0)

Switch to 1st iframe Switch to 2nd iframe body: <body> <!-- Technical Info --> <!-- Some Info --> <iframe name="AppFrame" src="path-to-another-app" seamless="" height="100%" width="100%" frameborder="0"></iframe> </body> body in except: <body> <!-- Technical Info --> <!-- Some Info --> <iframe name="AppFrame" src="path-to-another-app" seamless="" height="100%" width="100%" frameborder="0"></iframe> </body> Traceback (most recent call last): File "testSafariDriver.py", line 34, in <module> driver.switch_to_frame(driver.find_element_by_name("AppFrame")) File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 365, in find_element_by_name return self.find_element(by=By.NAME, value=name) File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 752, in find_element 'value': value})['value'] File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 236, in execute self.error_handler.check_response(response) File "/usr/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 192, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: An element could not be located on the page using the given search parameters. 添加到div

z-index

https://jsfiddle.net/jt00uk3e/6/

答案 1 :(得分:0)

试试这个:

&#13;
&#13;
table {
    width: 0px;
    table-layout: fixed;
}

td {
    width:50px;
    height:50px;
    overflow: visible;
}

#td1 {
  
    background-color: red;
}

#td2 {
    background-color: green;
}

#div2 {
  position:relative;
  z-index:1;
    width: 200px;
    height: 20px;
    background-color: blue;
    cursor: pointer;
}
&#13;
<table>
    <tr>
        <td id="td2"><div id="div2"></div></td>
        <td id="td1"></td>
    </tr>
</table>
&#13;
&#13;
&#13;