<br /> grr!!!

M

Mark Rae

Hi,

Can some kind soul please tell me how to stop <br> being automatically
reformatted as <br /> in VS.NET 2005...

Thanks,

Mark
 
R

rasdanATgmailDOTcom

<br /> is standard XHTML compliant. It does this by design. You want
this. It is not a bad thing.

James
 
G

Guest

But what I bet you don't want, and yet VS 2005 still does it, is for Visual
Studio to continue to modify your HTML for you.
 
J

Juan T. Llibre

If it's turning non standards-compliant XHTML into standards-compliant XHTML,
you do want Visual Studio to continue to modify your XHTML for you.

Otherwise, you'd be complaining that VS lets you code non standards-compliant XHTML.
 
C

Christopher Reed

Regardless, you will not be XHTML-compliant if you don't use a closing tag
or />.
 
M

Mark Rae

Regardless, you will not be XHTML-compliant if you don't use a closing tag
or />.

My question wasn't about being this-compliant or that-compliant - it was
about how to prevent VS.NET 2005 reformatting my HTML. This was the bane of
my life in previous versions, mainly when flipping between Design View and
Code View. That, thankfully, has now disappeared, but I still do not
appreciate someone at Microsoft deciding how they think I should write my
code. If I want to be XHTML-compliant, I'll use "<br />" instead of "<br>" -
I just want it to be my choice.
 
C

Christopher Reed

Actually, I don't believe that you can completely blame Microsoft for
enforcing standards by default. However, if you want it your way then do
this:

1) Go to the Tools menu and select Options....
2) Expand the Text Editor node and then expand the HTML node.
3) Select the Format node and then click on the Tag Specific Options....
4) In the dialog, select the Client HTML Tags node and expand it.
5) If "br" is not there, then select New Tag... and enter br into the
textbox and click OK. Otherwise....
6) Change the Closing tag dropdown to No closing tag and then click OK and
OK again.

From now on, you can now have <br> by default.

Please note that I only point the standards compliance only because at some
point in time it may be required by federal regulation due to ADA and some
similar requirements. Plus, by staying compliant, you have a better chance
of ensuring user-friendly renderings in multiple browsers. You may not care
about it, but it doesn't work right for your users, they may not come back.
 
M

Mark Rae

From now on, you can now have <br> by default.
Thanks.

Please note that I only point the standards compliance only because at
some point in time it may be required by federal regulation due to ADA and
some similar requirements.

LOL!
 
K

Kevin Spencer

Good points, Christopher. In addition, I might add that by conforming to XML
standards, one's web pages are, by definition, eXtensible, and can be
transformed to any other document type quite easily. While this may not seem
important now, lack of foresight is a common developer mistake. Always
anticipate change.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Hard work is a medication for which
there is no placebo.
 

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

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top