Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

line-height problems

0 views
Skip to first unread message

Mel Smith

unread,
Mar 5, 2013, 3:52:08 PM3/5/13
to
Hi:

Environ: IE8, Chrome (version: 25.0.1364.152 m), FF (version 16.0.2) ,
Safari (version 5.1.7) all running on my Win XP Pro machine

Question:

I trying to modify the amount of vertical space skipped on the <br />
tag

I'm tried several variations on the following 'line-height' attribute:

**********************************************
<span
style="margin-top:0px;margin-bottom:0px;padding:0px;line-height:0.5em;"><br
/></span>
**********************************************

I've even tried variations of:
*******************************
<br style="etc, etc, line-height:0.5em;" />
(but this doesn't work either)
*******************************
They all seem to work on values *greater than* 1em. (i.e., 4.0em
produces a large gap, 2.0 half the size of 4em., etc

However, below 1.0 em the vertical gap does *not* change (I've used
percentage values, px values, and still no change less than a standard <br
/>

Question:

How do I make the <br /> vertical distance to become smaller than 1.0
'normal' lines.

Thank you,

-Mel Smith



--
Mel Smith


David Stone

unread,
Mar 5, 2013, 4:23:51 PM3/5/13
to
In article <apn47t...@mid.individual.net>,
"Mel Smith" <med_cuto...@aol.com> wrote:

> Hi:
>
> Environ: IE8, Chrome (version: 25.0.1364.152 m), FF (version 16.0.2) ,
> Safari (version 5.1.7) all running on my Win XP Pro machine
>
> Question:
>
> I trying to modify the amount of vertical space skipped on the <br />
> tag
>
> I'm tried several variations on the following 'line-height' attribute:
>
> **********************************************
> <span
> style="margin-top:0px;margin-bottom:0px;padding:0px;line-height:0.5em;"><br
> /></span>
> **********************************************
>
> I've even tried variations of:
> *******************************
> <br style="etc, etc, line-height:0.5em;" />
> (but this doesn't work either)
> *******************************
> They all seem to work on values *greater than* 1em. (i.e., 4.0em
> produces a large gap, 2.0 half the size of 4em., etc
>
> However, below 1.0 em the vertical gap does *not* change (I've used
> percentage values, px values, and still no change less than a standard <br
> />

I do not think that attribute does what you think it does?

http://www.w3.org/TR/CSS21/visudet.html#propdef-line-height
"On a block container element whose content is composed of inline-level
elements, 'line-height' specifies the minimal height of line boxes
within the element."

Note the word "minimal"

In other words, it can be as small as that value, but will be larger
if needed to display the content.

This is really a CSS question, though, so follow-ups set accordingly.

James Moe

unread,
Mar 6, 2013, 12:46:18 PM3/6/13
to
On 03/05/2013 01:52 PM, Mel Smith wrote:
>
> Question:
> I trying to modify the amount of vertical space skipped on the <br />
> tag
>
What is the context of the markup where you are using a <br>?
Why is it more appropriate than a <p> or <div>?

--
James Moe
jmm-list at sohnen-moe dot com

Mel Smith

unread,
Mar 7, 2013, 6:43:35 PM3/7/13
to
James said:

> What is the context of the markup where you are using a <br>?
> Why is it more appropriate than a <p> or <div>?

James:

There is no 'context' as such. I'm already at the top of a <div> with a
black border around it, and I want to place some centered, underlined text a
bit below the top of the <div> without setting up a new <p> or a new
<div> --- just about 1/2 of a <br>, but something I can manipulate quickly,
and easily.

All I want to do is have a simple way for a <br /> to skip vertically a
'percentage' of the normal line-height of a <br />. If this is not easily
possible with a <br> then I'll forget it.

Thanks,

-Mel


dorayme

unread,
Mar 7, 2013, 6:46:11 PM3/7/13
to
In article <apsn1c...@mid.individual.net>,
James, please tell the OP that he has been told how to do roughly just
this.

--
dorayme

Chris F.A. Johnson

unread,
Mar 7, 2013, 6:59:01 PM3/7/13
to
I think you want padding:

<div style="padding-top: .5em;">

--
Chris F.A. Johnson
<http://torontowebdesign.cfaj.ca/>

Mel Smith

unread,
Mar 7, 2013, 7:36:17 PM3/7/13
to
Chris said:

> I think you want padding:
>
> <div style="padding-top: .5em;">
>

Hi Chris:

I'll try the 'padding' route tomorrow morning. It probably what I need

Thanks for the hint !

-Mel


tlvp

unread,
Mar 7, 2013, 8:53:39 PM3/7/13
to
On Thu, 7 Mar 2013 16:43:35 -0700, Mel Smith wrote:

> ... I want to place some centered, underlined text a
> bit below the top of the <div> without setting up a new <p> or a new
> <div> --- just about 1/2 of a <br>, but something I can manipulate quickly,
> and easily.
>
> All I want to do is have a simple way for a <br /> to skip vertically a
> 'percentage' of the normal line-height of a <br />. If this is not easily
> possible with a <br> then I'll forget it.

The impression I'm left with is that you think a <br /> is somehow
tantamount to a typewriter's carriage return, or a Unix newline. I used to
think that, too ... but it's a badly limping analogy. There are contexts
(after the last line of text in a table cell for example, if memory serves)
in which any number of <br> entries delivers no more added vertical skip
than just one does; and others (though memory won't tell me which) in which
the <br> might just as well not be there at all, for all the vertical skip
it delivers.

So just try Chris Johnson's padding approach instead :-) . Cheers, -- tlvp
--
Avant de repondre, jeter la poubelle, SVP.
0 new messages