maanushah
06-09-2010, 03:54 PM
Hello,
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.
http://www.freeuploadimages.org/images/re01vglrpdubofozwpft.jpg
Text on the colored bar as a heading on the page.
http://www.freeuploadimages.org/images/djv24plmij4h49j0a46.jpg
Please help,
Thanks!
rakasv
06-09-2010, 05:10 PM
for the first:
h1{
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
Apostropartheid
06-09-2010, 06:42 PM
You cannot have a paragraph inside a heading in HTML. This is wrong. Use a span instead.
rakasv
06-09-2010, 07:08 PM
you are so right!
thanks =) and as is told in my country "cada dia se aprende algo nuevo"
maanushah
06-09-2010, 07:58 PM
Thank you so much rakasv and Apostropartheid.
Can you give me the complete code with the span tags.
Thanks again!
Apostropartheid
06-09-2010, 08: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.