Ninjakreborn Posted September 25, 2006 Share Posted September 25, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/ Share on other sites More sharing options...
Daniel0 Posted September 25, 2006 Share Posted September 25, 2006 What do you mean? ??? Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98261 Share on other sites More sharing options...
ober Posted September 25, 2006 Share Posted September 25, 2006 Yeah... that doesn't make any bloody sense. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98266 Share on other sites More sharing options...
AndyB Posted September 25, 2006 Share Posted September 25, 2006 [quote author=businessman332211 link=topic=109425.msg440991#msg440991 date=1159198023]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.[/quote]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 Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98276 Share on other sites More sharing options...
Ninjakreborn Posted September 25, 2006 Author Share Posted September 25, 2006 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,Helloinsteadlike have a word document, inside the content div, they have likeHello, my name is dave, I watch tv a lot and each chips.<br />sometimes I don't care thoughlike that. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98287 Share on other sites More sharing options...
trq Posted September 25, 2006 Share Posted September 25, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98292 Share on other sites More sharing options...
ober Posted September 25, 2006 Share Posted September 25, 2006 ok... so how is that bad? Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98298 Share on other sites More sharing options...
Ninjakreborn Posted September 25, 2006 Author Share Posted September 25, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98315 Share on other sites More sharing options...
ober Posted September 25, 2006 Share Posted September 25, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98327 Share on other sites More sharing options...
Ninjakreborn Posted September 25, 2006 Author Share Posted September 25, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98334 Share on other sites More sharing options...
ober Posted September 25, 2006 Share Posted September 25, 2006 If you're just trying to get indentation on paragraphs, using p tags with some CSS will get you the indentation. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98339 Share on other sites More sharing options...
wildteen88 Posted September 25, 2006 Share Posted September 25, 2006 Look in to the pesudo classes/elements too. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98344 Share on other sites More sharing options...
Daniel0 Posted September 25, 2006 Share Posted September 25, 2006 I would say bad since [code]<?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>[/code] do [i]not[/i] validate. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98361 Share on other sites More sharing options...
Ninjakreborn Posted September 25, 2006 Author Share Posted September 25, 2006 [quote author=ober link=topic=109425.msg441074#msg441074 date=1159202609]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.[/quote]It probably does, or ober would have said something about it. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98393 Share on other sites More sharing options...
Daniel0 Posted September 25, 2006 Share Posted September 25, 2006 Ehhh, no it doesn't. Try to look at this: http://validator.w3.org/check?uri=http://xaos-ia.com/do_not_validate.html&ss=1[quote]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).[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98397 Share on other sites More sharing options...
ober Posted September 25, 2006 Share Posted September 25, 2006 Wow... you're kidding me. That must have changed because I don't think that's always been the case. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98424 Share on other sites More sharing options...
Daniel0 Posted September 25, 2006 Share Posted September 25, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98428 Share on other sites More sharing options...
Ninjakreborn Posted September 25, 2006 Author Share Posted September 25, 2006 ah, so I "shouldn't" just throw text out in the middle of the page like that? Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98434 Share on other sites More sharing options...
ober Posted September 25, 2006 Share Posted September 25, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98436 Share on other sites More sharing options...
jcombs_31 Posted September 25, 2006 Share Posted September 25, 2006 strict gets pretty tough, but makes more sense. Text has to be defined in some type of element. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98452 Share on other sites More sharing options...
Ninjakreborn Posted September 25, 2006 Author Share Posted September 25, 2006 So now everything is back to square one, for some people it's good, and for some people it's bad? Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98453 Share on other sites More sharing options...
AndyB Posted September 25, 2006 Share Posted September 25, 2006 [quote author=businessman332211 link=topic=109425.msg441204#msg441204 date=1159211302]So now everything is back to square one, for some people it's good, and for some people it's bad?[/quote]No, go back and re-read the commentary on DTD type. For 'good' people it's bad; for 'bad' people it's good enough :) Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98460 Share on other sites More sharing options...
wildteen88 Posted September 25, 2006 Share Posted September 25, 2006 No ones is saying its "bad". Just people have different opinions on which version of xHTML to use. I tend to use XHTML Transitional rather than XHTML Strict when creating XHTML pages.As long as the text is not on its own between the body tags and is defined in a div or some other tag, eg:[code]<?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><div id="container"> <div id="header"><h1>Some Header</h1></div> <div id="menu">Menu here</div> <div id="content">Hello</div> <div id="footer">Footer</div></div></body></html>[/code]It'll be fine.Sometime I tend to this:[code]<div id="content"> some opening paragrah <p>Secound paragraph</p> <p>Third paragraph</p> Last paragraph</div>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98461 Share on other sites More sharing options...
ober Posted September 25, 2006 Share Posted September 25, 2006 I should probably add that I do something similar. All my text is in some kind of div or something. Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98483 Share on other sites More sharing options...
steelmanronald06 Posted September 25, 2006 Share Posted September 25, 2006 It makes more sense to create a web page and enclose the text in HTML tags. Unless your doing a manual, and then no one is going to validate the damn manual. They are just going to read it and be done with it. Also businessman, if you want to validate your pages, and be lazy about the p tag at the same time, use Transitional and stay away from Strict. But if you want to put a bit of effort into your sites, and actually do the work of enclosing your text in some type of tag (p, div, span, etc) then use strict, and do what it requires you to do to meet its expectations Quote Link to comment https://forums.phpfreaks.com/topic/21993-putting-plain-text-to-the-browser/#findComment-98533 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.