我试图在缩放和旋转中获得div动画的背景图像,并使用div元素的伪::that元素半实现了这一点,并在该元素上具有背景图像。问题是,我似乎无法将原始div中的文本显示在动画背景前面,而且,在将图形裁剪到最终div大小的维度时,我也遇到了奇怪的问题。
这很难解释,但你可以在我的中更容易看到
这里是我的html:
<body>
<div id="box">
<h1>I want this title to stay in the foreground</h1>
</div>
</body>
这是我的css
我还没有找到任何文档,所以我不认为这是可行的。但这是值得一问的。
我可以在样式表中指定样式中的实际文本吗?
我有几个地方在相同的div位置中使用相同的文本。我没有使用javascript或在div中重新输入相同的文本,而是在思考是否可以在样式中插入实际的“文本”。
.someclass {
text:"for example"; /* this is how I'd imagine it, IF it were possible */
color:#000;
}
我可能是在推这个。
当内容为空时,为什么:before不显示任何内容,即使我设置了高度和宽度,但当我在内容中输入一些文本时,它会显示该文本?
CSS:
.a {
background-color: cyan;
height: 300px;
width: 200px;
margin-left: 50px;
}
.a:before {
/* This is the one that I change */
content: "test";
margin-left: -10px;
background-color: red;
我正在为我的网站创建一个登陆页面,并希望其中一个Jumbotrons给它一个现代和技术的感觉。我已经设法集中(水平和垂直)我的文本,我现在移动到背景图像。我遇到了一个问题,虽然我需要分区作为我的背景图像的高度,而文本仍然在中间。这是我的HTML
<div class="jumbo">
<div class="jumboCon">
<h1 class="centre">Kraft, unique</h1>
<p>The best present is a special
我有一个灵活的布局,显示一条长长的蓝线,然后在它之后的文本。
<div style="display: flex;">
<div style="width: 200px; height: 30px; background-color: blue;"></div>
<div>There's no space between me and the blue line</div>
</div>
现在我想把蓝线旋转90度:
<div style="displ
我要点击li标签上的第二个div文本。
还需要点击li span上的第3次div文本。
这是我的结构ul > li > label > span > div > div > div
$("#PlayListItem").on('click','label',函数(){ .on($(“#PlayListItem”).find(“div:nth-child(2)”).text();};$(“#PlayListItem”).on(‘.on’,'span',函数(){ .text });
伪元素(如::before或::after )中的内容实际上不存在于DOM树中。所以,用选择器定位是不可能的。
问题是,我怎样才能提取其中的内容?例如:
<div>This is <span></span>n apple.</div>
...
span::before {
content : "a"
}
shows : This is an apple.
但是,如果我提取div的文本,我只会得到没有span::before内容的This is n apple.。
我该如何处理这个问题?