我正在尝试使用一些容器和文本来执行显示/隐藏功能。当我点击某个容器时,我想要一个段落来隐藏。现在,当我单击"left"容器时,我正试图计算出"barbertext"段消失的情况。
<p class="hairtext" style="color:red">We are Thairapy, an independent hair <br> and beauty Salon located in the heart<br> of Exeter. At Thairapy, we care about&
我有一个div,定义的高度和溢出设置为隐藏。如果溢出内容中有锚,则div的可见内容将向上移动,这意味着我要显示的内容将从div顶部推开,锚将移动到div可见部分的中心。没有显示滚动条(这是一件好事),所以内容被固定在那里。
HTML
<div class="container">
<div class="show-content">Click in the box and hit tab</div>
<div class="overflow-content">
<
我在同一个组件的两个单独的渲染器中传递了两个prop,一个prop作为函数传递,另一个作为string传递。然而,在组件中访问它以进行呈现时,它会说:"props.prop1不是一个函数“
这是我的App.js文件:
import React from 'react';
import Test from './components/Test';
function App() {
return (
<div className="App">
<header className="Ap