Jump to content


Photo

putting plain text to the browser,


  • Please log in to reply
25 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 25 September 2006 - 03:27 PM

I sometimes see inside the html text dropped there, with no span, p, or pre tags.  Just put straight out to the browser, is this bad, if so why.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 25 September 2006 - 03:35 PM

What do you mean? ???

#3 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 September 2006 - 03:42 PM

Yeah... that doesn't make any bloody sense.

Info: PHP Manual


#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 25 September 2006 - 03:49 PM

I sometimes see inside the html text dropped there, with no span, p, or pre tags.  Just put straight out to the browser, is this bad, if so why.


Whether it's "bad" or not depends on your definition of "bad".  If it means unstyled that might be ugly but still informative so it's artistically bad but functionally good.  Or maybe it means that the author actually put all of the dispay style inside the body styles ... or maybe I don't understand the question either.
No, it's not 'bad'. It strongly
Legend has it that reading the manual never killed anyone.
My site

#5 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 25 September 2006 - 04:06 PM

Ok, I see sometimes, most of the time, people put text in p tags.
Like
<p>Hello</p>
or something, or they use span, or something else.  But sometimes I see someone just put text straight to the browser,
Hello
instead
like have a word document, inside the content div, they have like

Hello, my name is dave, I watch tv a lot and each chips.
<br />
sometimes I don't care though
like that.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#6 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 25 September 2006 - 04:11 PM

And your question is what? There is no law that says text must be in html format to be on the internet you know? In fact alot of man pages are printed in plain text so that those of us using terminal browsers might view them.

#7 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 September 2006 - 04:17 PM

ok... so how is that bad?

Info: PHP Manual


#8 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 25 September 2006 - 04:33 PM

I have had w3schools.com return some errors before along the lines of text not enclosed with a block or inline element or something similar, I was thinking it could have had to do with something like this?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#9 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 September 2006 - 04:43 PM

No.  There is no reason text has to be enclosed in tags within the browser and this is no reason the validator would give an error because of that.

Info: PHP Manual


#10 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 25 September 2006 - 04:51 PM

Ok good, then that is something I can start doing instead of using those p tags all the time, sometimes i need to get text to the browser, without anything but the text.  Like without the extra spacing, margin, padding that comes with p tags, so this might help me a lot at specific times, I was just encasing everything in span tags.  So I can start doing that instead, thanks for the help.
actually that's why I was asking, I would take a whole notepad, with special formating, and try to use like p tags and everything, so instead I could just copy and paste the whole notepad onto a webpage, within the content area. Then just use a non-breaking space to get the indenting, that will be a lot faster.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#11 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 September 2006 - 04:54 PM

If you're just trying to get indentation on paragraphs, using p tags with some CSS will get you the indentation.

Info: PHP Manual


#12 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 25 September 2006 - 04:56 PM

Look in to the pesudo classes/elements too.

#13 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 25 September 2006 - 05:24 PM

I would say bad since
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>test</title>
</head>
<body>

Hello

</body>
</html>
do not validate.

#14 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 25 September 2006 - 06:06 PM

No.  There is no reason text has to be enclosed in tags within the browser and this is no reason the validator would give an error because of that.

It probably does, or ober would have said something about it.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#15 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 25 September 2006 - 06:14 PM

Ehhh, no it doesn't. Try to look at this: http://validator.w3....idate.html&ss=1

You have used character data somewhere it is not permitted to appear. Mistakes that can cause this error include putting text directly in the body of the document without wrapping it in a container element (such as a <p>aragraph</p>) or forgetting to quote an attribute value (where characters such as "%" and "/" are common, but cannot appear without surrounding quotes).



#16 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 September 2006 - 06:40 PM

Wow... you're kidding me.  That must have changed because I don't think that's always been the case.

Info: PHP Manual


#17 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 25 September 2006 - 06:43 PM

I think it has been like that in quite a while, but I was not sure so I had to verify it by creating a document and validate it. I'm not sure if it is like that in XHTML 1.0 Transitional, but I personally think that you should use the latest version.

#18 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 25 September 2006 - 06:52 PM

ah, so I "shouldn't" just throw text out in the middle of the page like that?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#19 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 25 September 2006 - 06:53 PM

Ahh... see, that's what it comes down to.  It's all about the headers.  Personally, I think some of the headers are too strict... that's one reason why I never use strict and I've always stuck with transitional.

Info: PHP Manual


#20 jcombs_31

jcombs_31
  • Staff Alumni
  • Advanced Member
  • 2,066 posts
  • LocationFL

Posted 25 September 2006 - 07:07 PM

strict gets pretty tough, but makes more sense.  Text has to be defined in some type of element. 




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users