如何通过CSS添加徽标? [关闭]

How can I add my logo into my css stylesheet as I have tons of php pages and I dont want to manually add in one by one.

Basically I wan to have a global function so I just need to put in one page.

In css use background as below.

.logo { background : url(path_to_logo); }

just make a header include and include it on the top of every page?

Add

<div class="logo"> </div> 

in your header.

Add this to your stylesheet:

.logo { width: Zpx; height: Ypx; background-image: (pathtoimage.gif); }

Specifying your width and height diameters of course :)

Or if your logo was say 60px high you could do

body { 
padding:60px 0 0 0:
background-image : url(path_to_logo) no-repeat top left; 
}

Adding the logo to every body tag (common to every page

Ideally you would have a header.php file which you include in every page - by using

include('header.php');

Then any changes you make to this file will take effect throughout your site, such as adding

<h1>Site title</h1>
<img src="logo.jpg">