inserting blank space in html

T

Tony Vella

Can anyone please tell me how to insert a longish blank space in html which
IE would recognize. Let's say a space between "blank" and "space" the size
of "blank". TIA.
 
W

William Tasso

Tony said:
Can anyone please tell me how to insert a longish blank space in html
which IE would recognize. Let's say a space between "blank" and
"space" the size of "blank". TIA.

CSS:
p span {margin-left:5ex;}

HTML:
<p>blank <span>space</span></p>

modify margin value to suit.
 
T

Tony Vella

William said:
CSS:
p span {margin-left:5ex;}

HTML:
<p>blank <span>space</span></p>

modify margin value to suit.

Sorry, can't get the html to work. I'll try to show below what effect I'm
after.
*there was an old lady who lived in a shoe.*
(In case it doesn't show) I am trying to put, say, 10em between "lady" and
"who"
Thanks for helping William.
 
R

rf

Tony Vella said:
Sorry, can't get the html to work.

What? There is only one line :)

I'll try to show below what effect I'm
after.
*there was an old lady who lived in a shoe.*
(In case it doesn't show) I am trying to put, say, 10em between "lady" and
"who"

Which is what Williams example does, exactly. Well, not exactly, you would
have to specify margin-left: 10em.

Cheers
Richard.
 
M

Mark Parnell

Sometime around Fri, 21 Nov 2003 00:57:41 -0000, William Tasso is reported
to have stated:
CSS:
p span {margin-left:5ex;}

HTML:
<p>blank <span>space</span></p>

modify margin value to suit.

The other option would be to add a whole pile of non-breaking spaces
between the words. Depending on the purpose of the space (the OP was very
vague on that subject), this may be a better option, since non-CSS browsers
would still see the space. It could cause other undesirable results,
though.
 
T

Tony Vella

rf said:
What? There is only one line :)



Which is what Williams example does, exactly. Well, not exactly, you
would have to specify margin-left: 10em.

Cheers
Richard.

Hi Richard. Please don't misunderstand my question: I don't expect anyone
to take the time (waste his time actually) to spoon-feed me. But now I'm
getting pigheaded with this damn thing. Here are a few more details:

I have a text and between two particular words, say "red" and "white" I want
a space, say of 15em. So somewhere between <head> and </head> I type
CSS: p span {margin-left:5ex;}
then in the text I enter
<p>red<span>white</span></p>

What is happening is (one) CSS: p span {margin-left:5ex;}is showing in IE as
text at the top of the page and (two) I am getting a paragraph break right
before red.

In addition, I already have a CSS with these entries.

span {
font-family: serif;
font-size: smaller;
}

If I include a margin-left= entry, all the spans in the document will be
effected and not just the one between red and white. I have tried using
non-break spaces but it does look rather "untidy" if you wished to do it a
few times throughout the document. Thanks again.
 
T

Tony Vella

Tony said:
Hi Richard. Please don't misunderstand my question: I don't expect
anyone to take the time (waste his time actually) to spoon-feed me.
But now I'm getting pigheaded with this damn thing. Here are a few
more details:

I have a text and between two particular words, say "red" and "white"
I want a space, say of 15em. So somewhere between <head> and </head>
I type
CSS: p span {margin-left:15em;}
then in the text I enter
<p>red<span>white</span></p>

What is happening is (one) CSS: p span {margin-left:5ex;}is showing
in IE as text at the top of the page and (two) I am getting a
paragraph break right before red.

In addition, I already have a CSS with these entries.

span {
font-family: serif;
font-size: smaller;
}

If I include a margin-left= entry, all the spans in the document will
be effected and not just the one between red and white. I have tried
using non-break spaces but it does look rather "untidy" if you wished
to do it a few times throughout the document. Thanks again.
 
R

rf

Tony Vella said:
Hi Richard. Please don't misunderstand my question: I don't expect anyone
to take the time (waste his time actually) to spoon-feed me. But now I'm
getting pigheaded with this damn thing. Here are a few more details:

I have a text and between two particular words, say "red" and "white" I want
a space, say of 15em. So somewhere between <head> and </head> I type
CSS: p span {margin-left:5ex;}
then in the text I enter
<p>red<span>white</span></p>

<html>
<head>
<title>words</title>
<style type="text/css">
p span {margin-left: 15em;}
</style>
</head>
<body>
<p>some text that comes before the word "red"<span>white</span>some
following text</p>
</body>
What is happening is (one) CSS: p span {margin-left:5ex;}is showing in IE as
text at the top of the page and (two) I am getting a paragraph break right
before red.

In addition, I already have a CSS with these entries.

span {
font-family: serif;
font-size: smaller;

Don't use a font-size smaller than 100%.

}

If I include a margin-left= entry, all the spans in the document will be
effected and not just the one between red and white. I have tried using
non-break spaces but it does look rather "untidy" if you wished to do it a
few times throughout the document. Thanks again.

..wide {margin-left: 15em;}

.... <span class="wide">white</span>

Cheers
Richard.
 
S

Sid Ismail

: What is happening is (one) CSS: p span {margin-left:5ex;}is showing in IE as
: text at the top of the page


The "CSS:" means that you insert this into your head

<style type="text/css">
<!--
p span {margin-left:5ex;}
-->
</style>

Methinks you need this tutorial:
http://www.westciv.com/style_master/academy/hands_on_tutorial/


If that is not on, then stick in a filler.gif width=10 height=1.

Sid
 
T

Tony Vella

rf said:
<html>
<head>
<title>words</title>
<style type="text/css">
p span {margin-left: 15em;}
</style>
</head>
<body>
<p>some text that comes before the word "red"<span>white</span>some
following text</p>
</body>
IE

Don't use a font-size smaller than 100%.



.wide {margin-left: 15em;}

... <span class="wide">white</span>

Cheers
Richard.

Finally I got through my thick skull. Old age isn't fun! Thanks a lot
guys!
 
J

Jukka K. Korpela

rf said:
p span {margin-left: 15em;}

If that "works", it's a browser bug. By CSS specifications, margin
properties do not apply to inline elements like span. (It is well known that
IE violates the specifications in this respect. Mozilla, Opera, etc. don't.)

Use padding-left instead.
<p>some text that comes before the word "red"<span>white</span>some
following text</p>

When CSS is not in use, that displays as
.... the word "red"white some ...
so I think you should put a space before the <span> tag.
 
T

Tony Vella

Jukka K. Korpela said:
If that "works", it's a browser bug. By CSS specifications, margin
properties do not apply to inline elements like span. (It is well known that
IE violates the specifications in this respect. Mozilla, Opera, etc. don't.)

Use padding-left instead.


When CSS is not in use, that displays as
... the word "red"white some ...
so I think you should put a space before the <span> tag.


Thank you very much Yukka.
As per someone else's recommendation I have found a way out. I created a
transparent gif 10px high by 10px wide. I insert it wherever I need a space
and adjust the width. It's rather a simplistic way but works perfectly
every time. I am a stamp collector not a code writer, I'm afraid - I am
having a ball creating virtual albums of different stamp collections.
Example: http://members.rogers.com/tony.vella/mexico/index.html
 
J

Jukka K. Korpela

Tony Vella said:
As per someone else's recommendation I have found a way out. I created
a transparent gif 10px high by 10px wide. I insert it wherever I need a
space and adjust the width.

I wonder why you do it the hard and clumsy way when the simple and modern
way had been explained.
I am a stamp collector not a code writer,

Actually, it seems to me that you have done quite some unnecessary coding at
and the associated pages. And I cannot really see your original problem
there. If you had explained that you are using tables, and had illustrated
the situation with a URL, we might have addressed the real problems from the
start.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top