473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

Mel
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

Jul 21 '05 #1
10 6504
"Mel" <me**********@hp.com> wrote:
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----------------------


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

--
Spartanicus
Jul 21 '05 #2
Mel
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:t8********************************@news.spart anicus.utvinternet.ie...
"Mel" <me**********@hp.com> wrote:
i want to have a thin horizontal line of width 400px with a text placed onit 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----------------------


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

--
Spartanicus

Jul 21 '05 #3
"Mel" <me**********@hp.com> wrote:
"Spartanicus" <me@privacy.net> wrote in message
news:t8********************************@news.spar tanicus.utvinternet.ie...
"Mel" <me**********@hp.com> wrote:
>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----------------------
http://homepage.ntlworld.com/spartanicus/mel.htm

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


Are you changing the colour of your text frequently?
i need to specify a single color to be used for "line" & "text"
Then make a line graphic in the appropriate colour.
PS:- i dont have strip.png file either


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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #4
>
PS:- i dont have strip.png file either

Make one.

Steve


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.
Jul 21 '05 #5
Ståle Sæbøe <ot*****@tdz.no> wrote:
Steve Pugh <st***@pugh.net> wrote:
"Mel" <me**********@hp.com> wrote:
PS:- i dont have strip.png file either


Make one.

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


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 <st***@pugh.net> <http://steve.pugh.net/>
Jul 21 '05 #6
Mel wrote:
i want
something like:

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


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.
Jul 21 '05 #7
"Mel" <me**********@hp.com> wrote:
PS:- i dont have strip.png file either


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

--
Spartanicus
Jul 21 '05 #8
Spartanicus wrote:
"Mel" <me**********@hp.com> wrote:
PS:- i dont have strip.png file either


jpeg is a more appropriate format ;-)


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.
Jul 21 '05 #9
kchayka <us****@c-net.us> wrote:
PS:- i dont have strip.png file either


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


Not sure what the smiley is for


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

--
Spartanicus
Jul 21 '05 #10
kchayka wrote:
Spartanicus wrote:
"Mel" <me**********@hp.com> wrote:

PS:- i dont have strip.png file either


jpeg is a more appropriate format ;-)

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.


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"?
Jul 21 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Peter Brown | last post by:
Hello, The problem I am having is this: I would like an array to have three fields (item_id, item_unit, item_qty) - this I can do from prior postings. Now the Order entry form is...
14
by: Viken Karaguesian | last post by:
Hello all, It stinks being a newbie! One thing that I'm not sure about with CSS is: where is the "proper" place to put font attibutes? This has me a little confused. Take the below style sheet...
1
by: Sabine Oebbecke | last post by:
Hi there, Need some help again ... I have a continuous form which shows the attendees of a competition as per their placing in the competition. So, the first record is the winner, the second...
4
by: Phil Diwell | last post by:
Hi all. I am trying to place text over a picturebox. I thought I coul do this by making the textbox.backcolor property = color.transparent. However this doesn't work (textbox doesn't support...
14
by: Joe | last post by:
Hello All: I am trying to dynamically populate a web page with literal content and controls (textboxes and checkboxes (and eventually two buttons - the buttons do not appear in the code yet). I...
1
by: laredotornado | last post by:
Hello, I have a text file. I would like to write a line of data as the first line and then another as the last line. What is the easiest way to do this using php 4? Thanks, - Dave
6
by: napatel04 | last post by:
Hi everyone, I would like to know if there is a quick query someone can help me write for the following scenario. I think I can do this with VBA but since this is suppose to be a temp. solution,...
1
by: garek007 | last post by:
I'm wondering if there is such a way, without using javascript, to place a piece of text like a token, or identifier, that will get it's value from an outside source, such as a text file. So if I...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.