开发者

Need to put text over images in a table

开发者 https://www.devze.com 2023-02-10 16:55 出处:网络
I made a webpage in Photoshop CS4, slice开发者_运维问答d it up, threw it in a table in Dreamweaver CS4. http://www.themegan.info/lab4/index.htm (rough start, I know) Now, how do I go about putting tex

I made a webpage in Photoshop CS4, slice开发者_运维问答d it up, threw it in a table in Dreamweaver CS4. http://www.themegan.info/lab4/index.htm (rough start, I know) Now, how do I go about putting text on top of the images? Do I use CSS? I am just confused at this point.


<td style="position:relative;">
    <img src="..." style="position:absolute;z-index:1;" />
    <div style="z-index:2;position:relative;">your text goes here</div>
</td>


You could use the images as backgrounds of your layout "parts" through css. I.e.

html:

<div id="content">...text...</div>

css:

#content{
    background:url(..imgurl..) no-repeat top left;
}


Unless you want your users to interact with the image (i.e. the navigation menu images) you should use the css background-image property to make your design elements go to the background. Example:

td#sidebar { background-image:sidebarimg.jpg no-repeat; }

Then whatever text you put into your td element will automatically be on top of the image. This is especially important because it means a lot less upkeep will be required in maintaining your site.

0

精彩评论

暂无评论...
验证码 换一张
取 消