1

我是 html 的新手,而且这个网站的顶部图片似乎不知从何而来。通过检查源代码,我发现一个带有指向主页的链接和一个<span>Fragments of light</span>但没有img. 我错过了什么?谢谢!

4

3 回答 3

2

父 div#title将图像作为背景图像。

<style type="text/css">
        #title {
        background: url(http://colleenbriggs.files.wordpress.com/2012/12/cropped-fragments-of-light-low-res.jpg) no-repeat;
        height: 180px;
    }
</style>
于 2013-08-17T09:12:14.257 回答
0

I would recommend you to use FireBug plugin for Firefox or Developer Tools for chrome for finding out what you need about the markup on the page. Even IE has developer tool for that.

To use such tool you just need to hover the element on the page that you need, right click on it and select "Inspect Element" in the context menu. After that the FireBug/Developer Tools will appear at the bottom side of the browser and there on the left you will see all markup which is rendered right now and the element that you are inspecting will be selected. On the right you will be able to see all css and other properties of selected element. In these css you will see the backgroud image url. You will be able to change something there and immediately see the result of change on the page.

Using such tool is much easier and better than just inspecting the source code because the HTML can be changed after page load by javascript and you will not see these changes in the source code of the page but you will be able to see everything in the Firebug/Developer tools.

Check them out. They are Number 1 tools for Web Developer. And I agree with previous answers. The image is on the backgroud in css. You just need to know the way to see it by yourself. Not just know from internet =).

于 2013-08-17T09:27:31.123 回答
0

图片是css。

#title {
    background: url("https://colleenbriggs.files.wordpress.com/2012/12/cropped-fragments-of-light-low-res.jpg") no-repeat scroll 0 0 transparent;
    height: 180px;
}
于 2013-08-17T09:15:59.623 回答