DotDragnet
May 22, 2012, 01:50:11 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Mobile users - Our forum is Tapatalk enabled. http://www.tapatalk.com/
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Image Replacement  (Read 930 times)
Jeewhizz
DDN Contribs
Hero Member
*****
Posts: 1626



View Profile Awards
« on: January 21, 2008, 09:52:08 PM »

Hi Guys,

Trying to do a h1 image replacement for the header of one of my sites:

<a href='/'><h1>Title</h1></a>


h1 {
    padding-top: 89px; /* height of the replacement image */
    height: 0px;
    overflow: hidden;
    background-image: url("images/logo.png");
    background-repeat: no-repeat;
    margin-bottom:0px;
}

Now, the problem is, That's not valid HTML! How do I link the image whilst doing an image replacement, and maintaining valid code?

Cheers,
Jee
Logged

Mr Anderson
DDN Contribs
Hero Member
*****
Posts: 2267



ap4a.uk ap4a
View Profile WWW Awards
« Reply #1 on: January 21, 2008, 10:07:41 PM »

Code:
<h1><a href=""><span></span> Text</a></h1>

Put a non-breaking space in if you don't want a validator to tell you off for having an empty span.
Logged

Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF | SMF © 2006-2008, Simple Machines Valid XHTML 1.0! Valid CSS!