Connecting Tech Pros Worldwide Help | Site Map

HOW TO: place text on top of a line....

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 21st, 2005, 01:19 AM
Mel
Guest
 
Posts: n/a
Default HOW TO: place text on top of a line....

i want to have a thin horizontal line of width 400px with a text placed on
it with background white and the line should go through the middle of my
text vertically, similar to the top of a group box

something like:

----My Text Goes Here----------------------


thanks




  #2  
Old July 21st, 2005, 01:19 AM
Spartanicus
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

"Mel" <mel.m.heravi@hp.com> wrote:
[color=blue]
>i want to have a thin horizontal line of width 400px with a text placed on
>it with background white and the line should go through the middle of my
>text vertically, similar to the top of a group box
>
>something like:
>
>----My Text Goes Here----------------------[/color]

http://homepage.ntlworld.com/spartanicus/mel.htm

--
Spartanicus
  #3  
Old July 21st, 2005, 01:19 AM
Mel
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

But that means that i have no control over the color of the line :-(

i need to specify a single color to be used for "line" & "text"

sorry if i was not clear

please help

PS:- i dont have strip.png file either

"Spartanicus" <me@privacy.net> wrote in message
news:t8ap21d2ef1n6ojrir6hoifbob14bbs79e@news.spart anicus.utvinternet.ie...[color=blue]
> "Mel" <mel.m.heravi@hp.com> wrote:
>[color=green]
> >i want to have a thin horizontal line of width 400px with a text placed[/color][/color]
on[color=blue][color=green]
> >it with background white and the line should go through the middle of my
> >text vertically, similar to the top of a group box
> >
> >something like:
> >
> >----My Text Goes Here----------------------[/color]
>
> http://homepage.ntlworld.com/spartanicus/mel.htm
>
> --
> Spartanicus[/color]


  #4  
Old July 21st, 2005, 01:19 AM
Steve Pugh
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

"Mel" <mel.m.heravi@hp.com> wrote:[color=blue]
>"Spartanicus" <me@privacy.net> wrote in message
>news:t8ap21d2ef1n6ojrir6hoifbob14bbs79e@news.spar tanicus.utvinternet.ie...[color=green]
>> "Mel" <mel.m.heravi@hp.com> wrote:
>>[color=darkred]
>> >i want to have a thin horizontal line of width 400px with a text placed
>> >on it with background white and the line should go through the middle of
>> >my text vertically, similar to the top of a group box
>> >
>> >something like:
>> >
>> >----My Text Goes Here----------------------[/color]
>>
>> http://homepage.ntlworld.com/spartanicus/mel.htm
>>[/color]
>But that means that i have no control over the color of the line :-([/color]

Are you changing the colour of your text frequently?
[color=blue]
>i need to specify a single color to be used for "line" & "text"[/color]

Then make a line graphic in the appropriate colour.
[color=blue]
>PS:- i dont have strip.png file either[/color]

Make one.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
  #5  
Old July 21st, 2005, 01:19 AM
Ståle Sæbøe
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

>[color=blue][color=green]
>>PS:- i dont have strip.png file either[/color]
>
>
> Make one.
>
> Steve
>[/color]

Better yet, make a blank 1x1 pixel transparent gif and specify the
background color, width and height with css :)

That way you can use the same image for different colors and rectangular
shapes.
  #6  
Old July 21st, 2005, 01:19 AM
Steve Pugh
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

Ståle Sæbøe <othmaar@tdz.no> wrote:[color=blue]
>Steve Pugh <steve@pugh.net> wrote:[color=green]
>>"Mel" <mel.m.heravi@hp.com> wrote:
>>[color=darkred]
>>>PS:- i dont have strip.png file either[/color]
>>
>> Make one.
>>[/color]
>Better yet, make a blank 1x1 pixel transparent gif and specify the
>background color, width and height with css :)[/color]

I take it you didn't actally look at the sample code?

To do it your way would involve using more complex code as instead of
a simple background image you would need to use positioning to place
the text on top of the single pixel high div - and in fact you then
wouldn't need the image at all.

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <steve@pugh.net> <http://steve.pugh.net/>
  #7  
Old July 21st, 2005, 01:19 AM
kchayka
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

Mel wrote:[color=blue]
> i want
> something like:
>
> ----My Text Goes Here----------------------[/color]

HTML
<div><h1><span>My Text Goes Here</span></h1></div>

CSS
div {
padding-top: 1em;
background: #fff;
color: #000; }
h1 {
border-top: thin solid #999;
padding-left: 10%;
margin: .5em .2em 0 .2em; }
span {
background: #fff;
color: #000;
padding: 0 1%;
position: relative;
top: -.6em; }

This looks like one of the few cases where relative positioning actually
comes in handy. :) I only tested it in a handful of browsers, so no
guarantees.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
  #8  
Old July 21st, 2005, 01:19 AM
Spartanicus
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

"Mel" <mel.m.heravi@hp.com> wrote:
[color=blue]
>PS:- i dont have strip.png file either[/color]

I wouldn't recommend that you do one, but if you insist then I'd suggest
that jpeg is a more appropriate format ;-)

--
Spartanicus
  #9  
Old July 21st, 2005, 01:19 AM
kchayka
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

Spartanicus wrote:[color=blue]
> "Mel" <mel.m.heravi@hp.com> wrote:
>[color=green]
>>PS:- i dont have strip.png file either[/color]
>
> jpeg is a more appropriate format ;-)[/color]

Not sure what the smiley is for, but jpg is not more appropriate for
line drawings, for sure. A plain stripe should be png all the way.

--
Reply email address is a bottomless spam bucket.
Please reply to the group so everyone can share.
  #10  
Old July 21st, 2005, 01:19 AM
Spartanicus
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

kchayka <usenet@c-net.us> wrote:
[color=blue][color=green][color=darkred]
>>>PS:- i dont have strip.png file either[/color]
>>
>>I wouldn't recommend that you do one, but if you insist then I'd suggest
>>that jpeg is a more appropriate format ;-)[/color]
>
>Not sure what the smiley is for[/color]

http://www.geocities.com/ystradband/bigspender.html

--
Spartanicus
  #11  
Old July 21st, 2005, 01:19 AM
Ståle Sæbøe
Guest
 
Posts: n/a
Default Re: HOW TO: place text on top of a line....

kchayka wrote:[color=blue]
> Spartanicus wrote:
>[color=green]
>>"Mel" <mel.m.heravi@hp.com> wrote:
>>
>>[color=darkred]
>>>PS:- i dont have strip.png file either[/color]
>>
>>jpeg is a more appropriate format ;-)[/color]
>
>
> Not sure what the smiley is for, but jpg is not more appropriate for
> line drawings, for sure. A plain stripe should be png all the way.
>[/color]

jpeg delivers better overall quality and should be used with a fancy
line with shadows and lightning effects. However, be aware that jpegs
are not transparent and may thus clash with any background colors of the
document (or background images if used as an inline image).

png and gif delivers transparency (thus compatibility with whatever lies
beneath it) but at the cost of "prettyness".

Who is to say what is "appropriate"?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.