473,408 Members | 2,027 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,408 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 6506
"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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.