View Full Version : Creating A Color Bar on Html (Example Img Link) Help!

06-09-2010, 04:54 PM

I am trying to create a color bar on html?

See below images for details.

Text is between two bars as heading on the page.


Text on the colored bar as a heading on the page.


Please help,

06-09-2010, 06:10 PM
for the first:

margin: 0pt;
background-image: yourimage;
background-repeat: repeat-x;
background-position: center center;
width: 300px;
p {
display: block;
height: 50px;
background-color: white;
width: 150px;
position: relative;
left: 25px;

and your html:

<h1><p>TEXT HERE</p></h1>

for the second:

h1{background-color:#f8f8f8; width:300px; height:50px;color:#ffffff;}

for your html

<h1>TEXT HERE</h1>

just play with the styles untill you get what you want

06-09-2010, 07:42 PM
You cannot have a paragraph inside a heading in HTML. This is wrong. Use a span instead.

06-09-2010, 08:08 PM
you are so right!
thanks =) and as is told in my country "cada dia se aprende algo nuevo"

06-09-2010, 08:58 PM
Thank you so much rakasv and Apostropartheid.
Can you give me the complete code with the span tags.

Thanks again!

06-09-2010, 09:10 PM
you are so right!
thanks =) and as is told in my country "cada dia se aprende algo nuevo"

Yes. Yes we do. ;) well I don't speak Spanish but it's similar enough for me to understand.

Switch the h1 tag to a span and set it to display: block.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum