473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Is it OK to put carriage returns in web form HTML view ?

Hello.

When i look at a web form in design view, i have the option to view the
HTML. Some of the HTML code is in one long string and hard to read.

Is it OK to put in carriage returns and blank lines in the HTML so that is
is easier to read ?

I'm not talking about changing the HTML code logic, just the readability of
it.

Any help would be gratefully appreciated.

Thanks,
Tony
Oct 3 '06 #1
4 1660
Sure. You can break up an HTML tag as you need to and the browser won't
care. ASP.Net tags can also be broken up to span multiple lines. For
readibilities sake, I tend not to break up in the middle of an attribute
value unless it's really lone like the text property of a control. The
browsers are designed to ignore any extra whitespace other than one space so
you could break a signle HTML tag up to take as many lines as you need such
as:

<img
src="myimage.gif"
width = "100"
height="100"
>

--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

"Tony Girgenti" <tony(nospam)@lakesideos.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hello.

When i look at a web form in design view, i have the option to view the
HTML. Some of the HTML code is in one long string and hard to read.

Is it OK to put in carriage returns and blank lines in the HTML so that is
is easier to read ?

I'm not talking about changing the HTML code logic, just the readability
of it.

Any help would be gratefully appreciated.

Thanks,
Tony

Oct 3 '06 #2
Hi,

Tony Girgenti wrote:
Hello.

When i look at a web form in design view, i have the option to view the
HTML. Some of the HTML code is in one long string and hard to read.

Is it OK to put in carriage returns and blank lines in the HTML so that is
is easier to read ?

I'm not talking about changing the HTML code logic, just the readability of
it.

Any help would be gratefully appreciated.

Thanks,
Tony
A carriage return in HTML is rendered as a white space by the browser.
That can be annoying sometimes. For example if you want to place two
SPANs next to each other without any space, you cannot do this:

<span ...></span>
<span ...></span>

but you can do this:

<span ...></span><span
....></span>

If you choose carefully how to place your carriage returns, you won't
have a problem.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 3 '06 #3
Thanks for your replies.

"Laurent Bugnion" <ga*********@bluewin.chwrote in message
news:Oh**************@TK2MSFTNGP05.phx.gbl...
Hi,

Tony Girgenti wrote:
>Hello.

When i look at a web form in design view, i have the option to view the
HTML. Some of the HTML code is in one long string and hard to read.

Is it OK to put in carriage returns and blank lines in the HTML so that
is is easier to read ?

I'm not talking about changing the HTML code logic, just the readability
of it.

Any help would be gratefully appreciated.

Thanks,
Tony

A carriage return in HTML is rendered as a white space by the browser.
That can be annoying sometimes. For example if you want to place two SPANs
next to each other without any space, you cannot do this:

<span ...></span>
<span ...></span>

but you can do this:

<span ...></span><span
...></span>

If you choose carefully how to place your carriage returns, you won't have
a problem.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch

Oct 3 '06 #4
Hi,

Mark Fitzpatrick wrote:
Sure. You can break up an HTML tag as you need to and the browser won't
care. ASP.Net tags can also be broken up to span multiple lines. For
readibilities sake, I tend not to break up in the middle of an attribute
value unless it's really lone like the text property of a control. The
browsers are designed to ignore any extra whitespace other than one space so
you could break a signle HTML tag up to take as many lines as you need such
as:

<img
src="myimage.gif"
width = "100"
height="100"
>
I usually don't break attributes either, but there are notable exceptions:

<div style="color: Red;
background-color: Blue;
font-size: 2em;"

onclick="alert( 'Hello' );
alert( 'World' );">...</div>

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Guy Verville | last post by:
I'm perplexed, I have several forms that seem to be ok, but what is sent by email doesn't contain all the Carriage returns sent. The form contains many fields and is sent as follow:...
4
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to...
4
by: Josh | last post by:
Hi, I'm using System.Data.DataSet.ReadXml to convert some xml from a webservice to a DataSet. The xml looks like: <?xml version="1.0"...
2
by: eagleofjade | last post by:
I am trying to import data from a Word document into an Access table with VBA. The Word document is a form which has various fields. One of the fields is a field for notes. In some cases, this...
2
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost...
7
by: mattrapoport | last post by:
I have a page with a div on it. The div displays a user comment. When the user logs into this page, their current comment is pulled from a db and displayed in the div. The user can edit the...
2
by: GregBeagle | last post by:
Windows XP I have a simple form from which I want to generate an email with the contents of the form. I use carriage returns to format the content for readability. When I test it on my computer...
3
by: =?Utf-8?B?RGF2ZQ==?= | last post by:
I'm trying to download a webpage by using the HttpWebRequest. It returns the html source, however, it contains "\r\n", "\t" etc throughout the text. Is there a way to return the same HTML as when...
11
by: evenlater | last post by:
My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.