So what is supposed to replace the apparently depreciated <br> tag?

M

midori0x

I heard it here first, and have been reading it all over in other
tutorials and discussions, whenever someone notes the break tag might
not be the best idea in the world no one ever mentions what's actually
supposed to replace it.

I used a paragraph width value in my css code to get the lines to
break just where I want them to, is this a reasonable method or is
there a more appropriate way?
p {
width: 60%;
}
 
D

dorayme

I heard it here first, and have been reading it all over in other
tutorials and discussions, whenever someone notes the break tag might
not be the best idea in the world no one ever mentions what's actually
supposed to replace it.

I used a paragraph width value in my css code to get the lines to
break just where I want them to, is this a reasonable method or is
there a more appropriate way?
p {
width: 60%;
}

What is it that is motivating you to want the lines to break at
particular points? If it is that you don't want lines so long that that
they become hard to read, then limiting the width is an excellent
solution. Using <br> has some poor side effects when people use text
sizes you did not anticipate.

You have many choices these days to do this. You can specify a width or
a maximum width and you can do it in px, % and em. The latter can be
excellent for some purposes.

If you use max-width: 800px, say, this will guard against an unwanted
side effect of width: 800px;

Try these things to see why.
 
C

C A Upsdell

I heard it here first, and have been reading it all over in other
tutorials and discussions, whenever someone notes the break tag might
not be the best idea in the world no one ever mentions what's actually
supposed to replace it.

BR was never deprecated, however, it is often abused: for example, some
people use BR tags, instead of P tags, to define where paragraphs begin
and end.

What should be used instead depends on what you want. For example, if
you want to produce a larger vertical gap after a paragraph, the CSS
paragraph bottom margin should probably be set instead.
I used a paragraph width value in my css code to get the lines to
break just where I want them to, is this a reasonable method or is
there a more appropriate way?
p {
width: 60%;
}

In general it is not possible to get lines to break exactly where you
want them to: points at which lines break depend on many factors, many
of which -- for example, installed fonts and font sizes -- are not under
your control.
 
C

Chaddy2222

As of when?
Now if you don't want to use the tag, then try a division or block
element and set a fixed width to it.
That very BAD ADVICE!
You should never use a fixed width for any area that contains text.
Due to the fact that the page will break if the user re-sizes the text
so he or she can read it.
You should only use a px units for images and borders and the like.
Oh and if you have a block of text then place it in a paragraph (or
perhaps more then one).
 
D

dorayme

Chaddy2222 said:
You should never use a fixed width for any area that contains text.
Due to the fact that the page will break if the user re-sizes the text
so he or she can read it.

Perhaps it is better to say that authors should not choose any fixed
width that is likely to be exceeded by either a word's width at the very
most or a reasonable number of words (a la minimum newspaper column
widths) at about three or four clicks or so above the normal. In the
case of a navigation columns, the word restriction - indeed even the
more restricted restriction of the width of a particular word - is good
enough a measure rather than a satisfying number of words.
 
C

Chris F.A. Johnson

BALDERDASH!

One can not live by height alone. But then you'd probably say not to
use height either.

Ok smart boy, then tell us how you would define the dimensions of a
site utilizing 90% text in a header/3 column design?

With no width defined,

Who said anything about not defining a width?

What is bad is a fixed width (in px). Defining widths with ems or
percentages is fine.
 
D

dorayme

"Chris F.A. Johnson said:
What is bad is a fixed width (in px). Defining widths with ems or
percentages is fine.

Perhaps I am missing something of the context here but this does not
sound quite right to me. There is nothing inherently bad about defining
widths of elements that contain text in pixels. I am saying you cannot
know this a priori.
 
C

Chaddy2222

Perhaps I am missing something of the context here but this does not
sound quite right to me. There is nothing inherently bad about defining
widths of elements that contain text in pixels. I am saying you cannot
know this a priori.
I am not sure how it works on a Mac, but in most cases where you have
a width set in PX then things will get very messed up if you increase
the text size.
This will also depend on if the hight is fixed as well.
 
M

midori0x

What is it that is motivating you to want the lines to break at
particular points? If it is that you don't want lines so long that that
they become hard to read, then limiting the width is an excellent
solution. Using <br> has some poor side effects when people use text
sizes you did not anticipate.

You have many choices these days to do this. You can specify a width or
a maximum width and you can do it in px, % and em. The latter can be
excellent for some purposes.

If you use max-width: 800px, say, this will guard against an unwanted
side effect of width: 800px;

Try these things to see why.


I just need paragraphs to be a certain length, nothing too precise. If
you don't use some sort of formatting they run across the whole page
nearly, I wanted text that looks more like an article you'd see in a
magazine or newspaper. I also need text to be a certain size for
smaller paragraphs that will go under sidebar images for my articles.
Is putting the text in something like a div of a specified size and
letting the paragraph naturally break on it's own out of the question?
 
J

Jonathan N. Little

I just need paragraphs to be a certain length, nothing too precise. If
you don't use some sort of formatting they run across the whole page
nearly, I wanted text that looks more like an article you'd see in a
magazine or newspaper. I also need text to be a certain size for
smaller paragraphs that will go under sidebar images for my articles.
Is putting the text in something like a div of a specified size and
letting the paragraph naturally break on it's own out of the question?

No, that is how you can do it. You don't need a DIV your can style the P

p.sidebar { width: [some unit of length] }

What you want to avoid is setting both width and height else you will
have overflow problems when the text size|font varies.
 
C

Chris F.A. Johnson

Perhaps I am missing something of the context here but this does not
sound quite right to me. There is nothing inherently bad about defining
widths of elements that contain text in pixels. I am saying you cannot
know this a priori.

There may be rare instances where a fixed width is appropriate for
text; generally it is the wrong thing to do and is likely to break
the design if the viewer has a large text size, or it will not fit
in the viewer's window, or it may cause a narrow trickle of text
in a vast empty space, etc.....
 
D

dorayme

Chaddy2222 said:
I am not sure how it works on a Mac, but in most cases where you have
a width set in PX then things will get very messed up if you increase
the text size.
This will also depend on if the hight is fixed as well.


Operating systems are not really relevant to this. I am just saying that
setting widths in pixels does not make text unreadable or get anything
badly messed up in many contexts. Perhaps you are focussing on specific
types of situations where I would agree that em widthing (if at all)
would be best?
 
D

dorayme

I just need paragraphs to be a certain length, nothing too precise. If
you don't use some sort of formatting they run across the whole page
nearly, I wanted text that looks more like an article you'd see in a
magazine or newspaper. I also need text to be a certain size for
smaller paragraphs that will go under sidebar images for my articles.
Is putting the text in something like a div of a specified size and
letting the paragraph naturally break on it's own out of the question?

To your last question, you can do this, yes, it is not out of the
question. But it may not be necessary, you might just put a max-width on
a paragraph element itself.

But everything depends on your whole page and context. You want like
newspaper columns you say. But a web page is not a paper and you are
wanting one single feature (which you *can* get), namely, limited width,
but may not want or be able to get other features like real functioning
columns.

In other words, provide a URL that shows your general requirements where
any difficulties will be apparent...
 
D

dorayme

"Chris F.A. Johnson said:
There may be rare instances where a fixed width is appropriate for
text; generally it is the wrong thing to do and is likely to break
the design if the viewer has a large text size, or it will not fit
in the viewer's window, or it may cause a narrow trickle of text
in a vast empty space, etc.....

Well, I would not fancy having to calibrate "rare" over all the possible
website designs in advance. If it was fixed height we were talking, you
would be on much safer ground.
 
C

Chris F.A. Johnson

Well, I would not fancy having to calibrate "rare" over all the possible
website designs in advance. If it was fixed height we were talking, you
would be on much safer ground.

I have no trouble with the ground I am treading. I thought "rare"
was too broad.

Can you point to a single example where width for text is
appropriate in px, and em or % wouldn't do at least as well?
 
D

dorayme

"Chris F.A. Johnson said:
I have no trouble with the ground I am treading. I thought "rare"
was too broad.

Can you point to a single example where width for text is
appropriate in px, and em or % wouldn't do at least as well?

Why is this the test? If px did *as well*, then you are wrong to have
said fixed width (in px) is bad.

I really cannot understand your fundamentalist, on principle, a priori
stand. The world is simply more complex. I have no trouble popping in a
fixed width when I think it would be nice. And I have never seen any
*general* argument against it that is so powerful that it condemns every
possible case.

It is often quite respectable to fix a side bar in px if you know in
advance the content and it is often *perfectly OK* to do it in other
situations:

<http://dorayme.890m.com/alt/fixingAWidth.html>
 
D

dorayme

Ben C said:
In particular the sidebar might be set to the same width as some
decorative image or logo it might contain.

Which, in a significant way, is the principle behind the example in the
URL I made for Chris (which you snipped) when he asked for a case. I
often do not want a commentary on a picture or even a commentary that
the picture illustrates or a commentary that the picture somehow is
relevant to, or even not particularly relevant to but is decorative to
extend beyond the bounds of the side edges of a picture. This is a
perfectly legitimate thing to want if it does not cause trouble and the
picture is plenty wide not to encourage this.
 
C

Chaddy2222

Understand this, butthead. An em and % are variables dependent upon
the user's browser, machine and settings.
They have their places for certain things.
A pixel at least has some more fixed dimensions to it.
Yes I know all this. That is why they are not good for most things on
the web, as they do not re-size to fit a range of screen widths etc.

All browsers display them differently as well, such as IE with its
many well known margins bugs.
It also depends on the graphics card the person is useing and how high
or low the resolution is set.
You have your main columns set to a percentage. Designed for a
specific browser size.
Umm well actually I *DON'T*, which is why the site will change to fit
a very wide range of screen and browsing environments, including
PDA's.
What happens to the stuff inside those columns
when the browser is narrower? They get shrunk not in size, but in
width. So you might wind up with one word wide columns.
That is NOT MY PROBLEM!
The site is designed to work under a range of screen (or rather WINDOW
SIZES!
When are you going to get all this stuff through your thick head?
The web is NOT paper and anyone who says it is is full of shit or just
very cluless.
What exactly is an em? Each browser defines it differently.
A pixel, OTOH, is a know thing. If I set my column width to say 300
pixels, then it will remain at 300 pixels regardless of browser
physical width.
No it won't, you have no control over how anything on the web can be
displayed, you can only suggest how it will be displayed, it is up to
the user how that information will be displayed.
 
C

Chaddy2222

As in dorayme's example, pictures are usually sized in pixels. Yes you
can resize them, but often you don't want to.

So whenever you need to size something else relative to a picture, use
pixels.
Yes, if you read me previous post (my original reply to Richard), I
did say that I only use px units for sizeing things like images and
other such things that need to be a fixed unit. What he was suggesting
was to fix the size of a paragraph of text which is not a good idea.
 
J

Jonathan N. Little

Ben said:
In the future we might use SVG for diagrams, logos, etc. and just size
them in em or %, but photographs will still be pixels.

SVG would be nice, maybe someone should drop a hint to Jerry and Bill
while they are screwing with that family's life?
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top