1

I am very new to HTML or CSS, and maybe what I'm asking is very silly. My doubt is if it's possible to create a thumbnail displaying a picture and a title, and then when you click on it, a 'box' appears with the picture and a large text (some way similar to Safari's Reader function, or others). Is it possible?

As I said earlier I'm just starting with HTML and CSS.

4

1 回答 1

1

这确实是可能的。

首先我们创建一个 div,然后我们使用 css 选择背景属性,并使其适合。

这是代码:

<div class="img" style="
    overflow: hidden;
    height: 50px; <!-- Set the size of the div -->
    width: 50px;
    background: url(http://blog.moovweb.com/wp-content/uploads/2013/04/stackoverflow-logo.png);
    background-size: 50px 50px; <!-- Set the size of the image -->
    background-repeat: no-repeat;">
</div>

注意图像是如何被扭曲以适应盒子的。

您可以通过在 div 中键入文本来添加文本,或者通过创建一个新文本来重新定位文本。

希望这可以帮助!

于 2013-08-29T00:09:26.770 回答