


CSS problem of floating layer position in table td_html/css_WEB-ITnose
<html><head> <style type="text/css"> .td_myadd { vertical-align: bottom; } </style> <script language="javascript" type="text/javascript"> function getSelectedValue(ddl_id, text_id) { var obj = document.getElementById(ddl_id); var obj2 = document.getElementById(text_id); for (var i = 0; i < obj.options.length; i++) { if (obj.options[i].selected) { // return obj.value; if (obj.options[i].value.length > 0) obj2.value = obj.value; } } } </script></head><body> <table style="border:1px solid # 000;"> <tr> <td class="td_myadd" name="tname_dg4" style="display: "> <textarea name="sbd_repeater1$Repeater1$ctl00$txtbox_dg4|5" rows="2" cols="20" id="Textarea4" class="usernameFldinput" onblur="javascript:this.style.backgroundColor= ''" onfocus="javascript:this.style.backgroundColor= '#FFC1C1'" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'" onkeypress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false" style="overflow-y: hidden; height: 18px; width: 36px; border-bottom: black 1px solid; border-top-style: none; border-right-style: none; border-left-style: none; ime-mode: disabled;"></textarea> </td> <td class="td_myadd" name="tname_dg4" style="display: "> <textarea name="sbd_repeater1$Repeater1$ctl00$txtbox_dg4|5" rows="2" cols="20" id="sbd_repeater1_Repeater1_ctl00_txtbox_dg4|5" class="usernameFldinput" onblur="javascript:this.style.backgroundColor= ''" onfocus="javascript:this.style.backgroundColor= '#FFC1C1'" onpropertychange="this.style.height=this.scrollHeight + 'px'" oninput="this.style.height=this.scrollHeight + 'px'" onkeypress="if (event.keyCode!=46 && event.keyCode!=45 && (event.keyCode<48 || event.keyCode>57)) event.returnValue=false" style="overflow-y: hidden; height: 18px; width: 36px; border-bottom: black 1px solid; border-top-style: none; border-right-style: none; border-left-style: none; ime-mode: disabled;"></textarea> </td> <td class="td_myadd" name="tname_sl2111" style="display: "> <div style="margin-bottom: 20px; width: 61px"> <div style="position: absolute; z-index: 1"> <select name="sbd_repeater1$Repeater1$ctl00$txtbox_sl2111|5$ddl1" id="sbd_repeater1_Repeater1_ctl00_txtbox_sl2111|5_ddl1" onclick="getSelectedValue('sbd_repeater1_Repeater1_ctl00_txtbox_sl2111|5_ddl1','sbd_repeater1_Repeater1_ctl00_txtbox_sl2111|5_tb1')" style="border-bottom: black 1px solid; border-top-style: none; border-right-style: none; border-left-style: none; width: 61px;"> <option value=""></option> <option value="不含税">不含税</option> </select> </div> <div style="position: absolute; z-index: 2"> <input name="sbd_repeater1$Repeater1$ctl00$txtbox_sl2111|5$tb1" type="text" id="sbd_repeater1_Repeater1_ctl00_txtbox_sl2111|5_tb1" style="width: 46px; border-bottom: black 1px solid; border-top-style: none; border-right-style: none; border-left-style: none; width: 46px;" /> </div> </div> </td> <td class="td_myadd" name="tname_dw" style="display: "> <div style="margin-bottom: 20px; width: 61px"> <div style="position: absolute; z-index: 1"> <select name="sbd_repeater1$Repeater1$ctl00$txtbox_dw|5$ddl1" id="sbd_repeater1_Repeater1_ctl00_txtbox_dw|5_ddl1" onclick="getSelectedValue('sbd_repeater1_Repeater1_ctl00_txtbox_dw|5_ddl1','sbd_repeater1_Repeater1_ctl00_txtbox_dw|5_tb1')" style="border-bottom: black 1px solid; border-top-style: none; border-right-style: none; border-left-style: none; width: 61px;"> <option value=""></option> <option value="PCS">PCS</option> <option value="个">个</option> <option value="公斤">公斤</option> <option value="计">计</option> <option value="元">元</option> </select> </div> <div style="position: absolute; z-index: 2"> <input name="sbd_repeater1$Repeater1$ctl00$txtbox_dw|5$tb1" type="text" id="sbd_repeater1_Repeater1_ctl00_txtbox_dw|5_tb1" style="width: 46px; border-bottom: black 1px solid; border-top-style: none; border-right-style: none; border-left-style: none; width: 46px;" /> </div> </div> </td> </tr> </table></body></html>
输入框会自动换行,把TD撑大,TD的样式 vertical-align: bottom;
但是右边的 没有居下
右边的是可输入的下拉框,做了3个层,一个输入框,一个下拉框,
我想TD撑大时那堆东西都居下对齐。有没有用样式可以解决的方案。不用JS。
回复讨论(解决方案)
有人能来看看嘛
给td加个 position:relative; 然后给td的子标签加position:absolute; 然后设置该div的bottom属性就可以了...

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.
