Connecting Tech Pros Worldwide Help | Site Map

styling a <br class="spacer" />

Richard Barnet
Guest
 
Posts: n/a
#1: Jul 20 '05
I'm trying to style a line break, something like this:

<br class="spacer" />

via CSS, but none of the following seems to have any effect. Any ideas?

br.spacer {
clear: both;
height: 50px;
margin-bottom: 20px;
padding-bottom: 20px;
min-height: 20px;
white-space: normal;
clip: auto;
margin-top: 20px;
padding-bottom: 20px;
vertical-align: 20px;
}

(I'm trying to put a little vertical space in between some images. Since
the images are displayed inline [as opposed to block], I had to put a <br />
in between them to have them display vertically. By doing so, of course,
they're sitting right on top of each other. I don't want to use any <img />
padding or margins because that would affect other images elsewhere - and I
don't want to create another class of images just for this. I think a
simple break in between images should suffice, with the appropriate styling,
of course.)

-- Richard


Stan Brown
Guest
 
Posts: n/a
#2: Jul 20 '05

re: styling a <br class="spacer" />


In article <be2eeb$ipl$1@nnrp.atgi.net> in
comp.infosystems.www.authoring.stylesheets, Richard Barnet
<rbarnet@csaNOSPAMreno.org> wrote:[color=blue]
>I'm trying to style a line break, something like this:
>
><br class="spacer" />
>
>via CSS, but none of the following seems to have any effect. Any ideas?
>[/color]

<br> is not a block-level element.
[color=blue]
>(I'm trying to put a little vertical space in between some images.[/color]

Why introduce extra HTML elements? Isn't it easier and more direct
to style the images themselves (either via class or ID) with the
desired padding or margins?

--
Stan Brown, Oak Road Systems, Cortland County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2 spec: http://www.w3.org/TR/REC-CSS2/
validator: http://jigsaw.w3.org/css-validator/
Evertjan.
Guest
 
Posts: n/a
#3: Jul 20 '05

re: styling a <br class="spacer" />


Stan Brown wrote on 04 jul 2003 in
comp.infosystems.www.authoring.stylesheets:
[color=blue]
> In article <be2eeb$ipl$1@nnrp.atgi.net> in
> comp.infosystems.www.authoring.stylesheets, Richard Barnet
> <rbarnet@csaNOSPAMreno.org> wrote:[color=green]
>>I'm trying to style a line break, something like this:
>>
>><br class="spacer" />
>>
>>via CSS, but none of the following seems to have any effect. Any ideas?
>>[/color]
>
> <br> is not a block-level element.
>[color=green]
>>(I'm trying to put a little vertical space in between some images.[/color]
>
> Why introduce extra HTML elements? Isn't it easier and more direct
> to style the images themselves (either via class or ID) with the
> desired padding or margins?
>[/color]

or use

<p class="spacer" />

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jacqui or (maybe) Pete
Guest
 
Posts: n/a
#4: Jul 20 '05

re: styling a <br class="spacer" />


In article <be2eeb$ipl$1@nnrp.atgi.net>, rbarnet@csaNOSPAMreno.org
says...[color=blue]
> I'm trying to style a line break, something like this:
>
> <br class="spacer" />
>[/color]
....[color=blue]
> (I'm trying to put a little vertical space in between some images. Since
> the images are displayed inline [as opposed to block], I had to put a <br />
> in between them to have them display vertically. By doing so, of course,
> they're sitting right on top of each other. I don't want to use any <img />
> padding or margins because that would affect other images elsewhere - and I
> don't want to create another class of images just for this. I think a[/color]
....
The images are wrapped in something surely? A div maybe? So use:

div#thing img { display: block; margin: 5px 0; }
Christoph Paeper
Guest
 
Posts: n/a
#5: Jul 20 '05

re: styling a <br class="spacer" />


*Richard Barnet* <rbarnet@csaNOSPAMreno.org>:[color=blue]
>
> I'm trying to style a line break, something like this:
>
> <br class="spacer" />[/color]

How do you expect an element to be styled that (AFAIK) doesn't generate a
CSS box?

--
The Hitchhiker's Guide to the Galaxy:
"The Universe, as has been observed before, is an unsettlingly big place,
a fact which for the sake of a quiet life most people tend to ignore."
Tim
Guest
 
Posts: n/a
#6: Jul 20 '05

re: styling a <br class="spacer" />


On Thu, 3 Jul 2003 16:32:25 -0700,
"Richard Barnet" <rbarnet@csaNOSPAMreno.org> wrote:
[color=blue]
> (I'm trying to put a little vertical space in between some images. Since
> the images are displayed inline [as opposed to block], I had to put a <br />
> in between them to have them display vertically. By doing so, of course,
> they're sitting right on top of each other. I don't want to use any <img />
> padding or margins because that would affect other images elsewhere - and I
> don't want to create another class of images just for this. I think a
> simple break in between images should suffice, with the appropriate styling,
> of course.)[/color]

If you're prepared to make a special class of br between those images,
why not make a special img class, just for those images? (Leaving most
other images to display as normal.) After all, it really is the
presentation of those images which you're playing with; and I really
can't see how it's more work to produce a special class for those image
elements, than the br element (or something else).

Alternatively, you could make a special div class around those images,
and apply your styles to images that are children of your special div
class. But you're still going to create a special class of something,
whatever method you choose, just for those images.

You're avoiding using CSS to do the job properly (directly affect the
thing you want to modify), and playing the tag soup game (messing with
other things, to try and achieve the desired result - br is a "line
break").

--
My "from" address is totally fake. The reply-to address is real, but
may be only temporary. Reply to usenet postings in the same place as
you read the message you're replying to.
Closed Thread