473,547 Members | 2,553 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6511
"Mel" <me**********@h p.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

"Spartanicu s" <me@privacy.net > wrote in message
news:t8******** *************** *********@news. spartanicus.utv internet.ie...
"Mel" <me**********@h p.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**********@h p.com> wrote:
"Spartanicus " <me@privacy.net > wrote in message
news:t8******* *************** **********@news .spartanicus.ut vinternet.ie...
"Mel" <me**********@h p.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**********@h p.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**********@h p.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**********@h p.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

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

Similar topics

3
1568
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 something like
14
2641
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 (which is a work in progress) as an example. If I don't put the font attributes in the <body> <p> and <td> tags, the font will not appear the way I...
1
1754
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 record is the 2nd place, etc. The continuous form's recordsource is an updatable query. The query/form has got a field 'place' into which the...
4
4794
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 transparent backcolor) and so I am wondering if anyone knows how I can do this. I need to be able to put multiple lines of text over the...
14
2307
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 read an xml file and, using the values retrieved from it, determine what text should be displayed and which controls should be rendered and - most...
1
1427
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
7711
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, I really do not want to spend too much time on it. I have two tables, 1 an old one which has work done in it with all the necessary columns...
1
1384
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 make a standard link using html, I want the link text to be a token that uses a line of the same name on an external file to get its value. For...
0
7510
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7437
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7703
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7463
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7797
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6032
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5362
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5081
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3473
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.