Return to the Web Authoring Forum | Post a Follow-Up

 o
pre tag vs. white-space:pre style

Posted by chuggerguy (My Page) on
Wed, Apr 9, 14 at 22:13

    

this is in
a pre tag

this is in
a white-space:pre div

They seem to look pretty much the same while typing them. "div" is lined up directly under "tag" etc.

<div style="white-space:pre;"> may be a few more characters to type than <pre> but I often add a couple other styles anyway. Such as border and background.

Easier than a table if you just want some quick aligned columns? Or just an alternative method, another tool?


Follow-Up Postings:

 o
RE: pre tag vs. white-space:pre style

A B C D
1 2 3 4
5 6 7 8


 o
RE: pre tag vs. white-space:pre style

A B C D
1 2 3 4
5 6 7 8


 o
HTML5 video revisited

Not the type of music I typically listen to. I like the electric violin though.







Just in case that's South of the Equator...


This post was edited by chuggerguy on Fri, Jun 13, 14 at 15:27


 o
Firefox 29

Classic Theme Restorer plus I learned to apply a smidgeon of CSS to the UI using userChrome.css. Like removing the hamburger. And to fix "Show Go", which v29 broke. Amazing how many times I find myself sitting on a page wanting a fresh load without resubmitting form data.





A different(leaner?) look within a portable version Firefox I threw together and modified using this as a starting point.



This post was edited by chuggerguy on Wed, Jun 4, 14 at 14:45


 o
RE: pre tag vs. white-space:pre style

The pre tag is for long strings that you don't want broken. Usually used when typing out code. It'll put the entire contents of what's between the pre tags on one line, and add line breaks only when you put one in there. It *will* fall outside of your layout if the space allotted for text is smaller than the amount of content you put in it.

A div is a block of content. It will always take up the full line of where you place it, unless you float it, or display:inline. And don't out styles in your content - that's what CSS is for. Add a class to the div if you want to add a style to it, that way, you can universally edit the style via the class.

If you want tabular columns of data, use a table. That's what they are for.


 o Post a Follow-Up

Please Note: Only registered members are able to post messages to this forum.

    If you are a member, please log in.

    If you aren't yet a member, join now!


Return to the Web Authoring Forum

Information about Posting

  • You must be logged in to post a message. Once you are logged in, a posting window will appear at the bottom of the messages. If you are not a member, please register for an account.
  • Posting is a two-step process. Once you have composed your message, you will be taken to the preview page. You will then have a chance to review your post, make changes and upload photos.
  • After posting your message, you may need to refresh the forum page in order to see it.
  • Before posting copyrighted material, please read about Copyright and Fair Use.
  • We have a strict no-advertising policy!
  • If you would like to practice posting or uploading photos, please visit our Test forum.
  • If you need assistance, please Contact Us and we will be happy to help.


Learn more about in-text links on this page here