我正在嘗試向我的網(wǎng)站添加一個(gè)小功能,用戶可以在插入輸入之前將鼠標(biāo)懸停在問號(hào)上,問號(hào)將顯示有關(guān)問題的更多信息。這是我到目前為止所做的,但它在自己的單獨(dú)行上顯示小工具提示功能(我知道這是因?yàn)闃?biāo)簽),但我希望標(biāo)簽和小問號(hào)彼此相鄰.<div> <label htmlFor="dropdown"> Table Name: </label> <div className="help-tip"> <p> More info about what this is asking for exactly.</p> </div> <input className='input' value={this.state.selectedSchema.value} onChange={(event) => this.setState({ selectedTableName: event.target.value }) }> </input></div>CSS: .help-tip{ top: 18px; text-align: center; background-color: #0095d9; border-radius: 50%; width: 20px; height: 20px; font-size: 10px; line-height: 21px; cursor: default; margin-left: 320px;}.help-tip:before{ content:'?'; font-weight: bold; color:#fff;}.help-tip:hover p{ display:block; transform-origin: 0% 100%; -webkit-animation: fadeIn 0.3s ease-in-out; animation: fadeIn 0.3s ease-in-out;}.help-tip p{ /* The tooltip */ display: none; text-align: left; background-color: #0095d9; padding: 10px; width: 300px; border-radius: 3px; box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2); right: -4px; color: #FFF; font-size: 10px; line-height: 1.4;}.help-tip label{ display:block; width: 300px; height: 300; text-align: left; margin-left: 0px; margin-right: 300px;}.help-tip p:before{ /* The pointer of the tooltip */ content: ''; width:0; height: 0; border:6px solid transparent; border-bottom-color:#0095d9; right:10px; top:-12px;}.help-tip p:after{ /* Prevents the tooltip from being hidden */ width:100%; height:40px; content:''; top:-40px; left:0;}工具提示 HTML 和 CSS 信用轉(zhuǎn)到:https : //tutorialzine.com/2014/07/css-inline-help-tips
如何調(diào)整“工具提示”的位置,使其在我的 <label> 旁邊?
藍(lán)山帝景
2021-07-07 13:00:37