Html should i use br




















So br's can be just fine…. I miss the perspective of a CMS programmer. Sometimes you really want your P, but is a BR much easier to implement. I agree with Chris, but also with Per. I think sometimes people forget that however important semantics and usability etc are, they are not the only rules in web design. There's also the rules of typography and a heading like Per describes is plain bad typography. If only a line break can fix this, that's fine with me.

I've had to come up with a similair solution to what Per is taking about second comment before when designers thought it was of extreme importance that the text shifted down a line in the midde of the heading. Teddy: actually I think a br tag is more semantically correct. After all, you want the line to break, and that's what the br tag is for…. According to the new Web Applications 1. If extra non-semantic tags were required for this I'd typically let them go but everyone has a limit as to how much extra crap they're prepared to put their name to.

Graphic design is about much more than just making things look appealing. A well-designed website is easier to read and understand, so graphic design is an important aid in usability. And so is good typography. Having said that, of course design is also about eye candy. And there's nothing wrong with eye candy.

In fact, a site that's easy on the eye is easier to use. I'm getting a bit annoyed with all those developers who keep saying that design is nothing more than superficial, useless eye candy.

An ugly site is hard to use, however well-built. And finally, of course many sites' main purpose is amusement rather than content. And it's usually a combination of both not to mention branding etc.

Oh well, all I meant to say is I think it's ok to make sacrifices in semantics if that can solve a typographical problem and there's no other way to solve it. Maaike, sacrificing semantics for layout or design shouldn't be the case.

All it takes is a bit of creativity. Even then, I try to minimize any use of it. I do — if the need arises and it seems a semantically correct solution. Nulla vulputate nibh et nisi rutrum porttitor. Quisque urna. Maecenas id odio eget tellus egestas scelerisque. In facilisis. Cras massa libero, mollis vel, adipiscing in, viverra non, mi. Vivamus tincidunt tincidunt velit. Nunc venenatis. Duis sodales facilisis ligula.

Proin elit nisl, dapibus non, mollis vel, tempus vel, neque. Vivamus hendrerit sem id eros. Donec a dolor quis nunc iaculis molestie. Integer vehicula venenatis nulla. Vivamus nec elit eu sapien aliquet vulputate.

Ed: I know that, of course. But an occasional extra line break is not exactly a disaster for any user agent. I think Eugene's example is a good one.

Do you have a better idea for this situation? Poems and addresses are surely clear examples of when a break element is the semantically correct choice over several paragraph elements. And I can see the logic extended to a heading, but that is more of a presentation choice in my opinion. May I also raise the presentation and readability issue of orphans.

This is particularly prevalent in fluid designs, where quite often you can end up with a single short word on a line of its own that looks awful and ruins readability. I've toyed with a little server side intervention that puts a non-breaking space between the last two words of all paragraphs — any thoughts about that? I would agree it should be a browser setting, but in the absence of such….

I use the BR element, whenever I need a line break in my content. It has nothing at all to do with design. I can't think of a case where two or more BRs in a row would be acceptable, though. Thanks for sharing, everyone; very good input! I really think this is an interesting discussion, and I'm happy that you think that too. I can.

If you write a postal address in Germany it's common to separate the street and the city by a blank line. There's no need for extra spans or anything, you even get rid of a element from his example. In my opinion, that space should be handled by CSS. It is presentational, not semantic. Infact I'll even admit I use two br's because sometimes it looks better than one duck , and I'm too lazy to code css to interperate a simple br. And of course on the flip side, simple technique is always great when viewing the page without any style.

However, I don't normally use breaks to break up a running paragraph, whereas I prefer it to wrap naturally. I think it's all so trivial, and I don't forsee these tags going away anytime soon..

Maybe I'm over-simplifying, but if we are to remain credible and consistent with what we preach, using BR for line breaks is the most obvious choice. We're doing our best to convince our clients to use semantic markup…. What we can tell them though is that they should start new paragraphs when moving to another point, not BRs. I usually need 2 lines between paragraphs… but for some reason.. I squeeze in an invisible image between the br:s to decide the perfect row space.

How wrong is that? This way when I wrap each paragraph there is a 20px space between total, between the top and bottom of each paragraph. Using p and h1 h2 properly, etc tags are important for one reason and one reason alone…. If someone is looking for something, all your important content should be in the p and h1 h2 tags. That's what I heard. I'm still trying to figure out if img and object tags go inside p tags. So far I do not put them in p.

However, when I upload the page to the web, I'm seeing an extra space after the heading. I never ever use said tag, at least when working alone. It's nice to be reminded that it perhaps does have a semantic meaning. I only ever seem to see it used presentationally, say to make room for a positioned element in the space it can create… Or to make paragraphs, or other kinds of crimes. I wrote and maintain a business website. I have found that the BR tag has a place in a website.

By using the BR tag I can eliminate several usless div's. See Bed and BReakfast. There are occasions where it is the proper tag to use, but it is abused often enough that people adopt a "do not use" mentality as to force better semantic thinking. For example :. Other than that, I can not think of anything speaking against line breaks as such. Same concept applies to why we don't use tables for layout - use tables for tables and CSS for layout.

Specifying the layout directly makes it difficult adapting the site for different page sizes or fonts for example. I try to write my markup in a way that it's easily readable with CSS disabled. If you're just using BRs to add spacing, it's better to use margins and padding. For example, if you need extra space between paragraphs, give them a class and apply the extra padding to the paragraphs.

They are to be used to represent newlines. Nothing more. Not to fill up space like as at the average geocities site. There is however only one case wherein they may be useful for other purposes than putting a newline: to clear the floats. They're fine, if used appropriately. You're probably doing something wrong if you ever have two in a row.

Its use can be avoided like,. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Ask Question. Asked 12 years ago. Active 4 months ago. Viewed 90k times. David J. The best way to find the best answer is go to your dev team and ask them WHY? Amen to that Ask the source, not someone who is going to guess.

Usually "first advice" comes when the employee is new. A new employee does not always feel like asking "why? Or at least understands what the HTML community at large things about the subject well enough to discuss it.

I'd say he made the right move coming here to ask. Add a comment. Active Oldest Votes. Gareth Gareth k 35 35 gold badges silver badges bronze badges. This way, you explicitly specify that the intent is to keep original composition, including possible indentations. Newlines are semantically meaningful, 2. There exists no other semantically appropriate tag, like a paragraph or header tag.



0コメント

  • 1000 / 1000