You are here: CSS background-image issue « HTML « IT news, forums, messages
CSS background-image issue

Posted by z on 11/06/06 15:20

I'm trying to recreate a header image in proper HTML with an <h1> header.

The <h1> header is of variable length, but should cover the background image
(header.gif) which is just a straight fixed-length grey line like this:

The Header -------------------------------|

The width of "The Header" will change with the length of the text and with
the font size. The line is a gif, so it shows through the text if it
overlaps, which looks bad.

Is there a way to cover up the background line with the <h1> so that it
doesn't show through the text? The following HTML/CSS is just from my
first tests. There must be a better way to do it.




The CSS:

#gif2header {
width: 600px;

}
#gif2header h1 {
font-size: 13px;
color: #f60;
background-color: #fff;
font-family: Arial, Helvetica, sans-serif;
background-image: url('header.gif');
background-repeat: no-repeat;
margin-bottom: 0;
}


The HTML:

<div id="gif2header">
<h1>The Header Title</h1>
<img src="quote.gif" alt="">
</div>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация