How to use the "pre" tag correctly

Hello,

I’ve been trying to add empty spaces between some HTML text I’m using as a menu but that is always stripped by the browser.

I searched a bit and found that by using the “pre” tag I should be able to solve this issue. However, it doesn’t really work as I thought it would because now the text baseline is shifted down about 8px and distorting my layout. What is the trick to achieve what I want?

Example:
Instead of “Menu1 | Menu2”
I’d like to see “Menu1 | Menu2”

Thanks,
Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

It was always my understanding that the PRE tag was used for showing code snippets, but in your case you should use:

 

which is the HTML equivalent of a space. So in your menu example it’d look like:

Menu1 | Menu2

So if you wanted to two spaces after the pipe character it’d look like:

Menu1 |  Menu2

Try that and see if that works for you. You’ll have to write the code manually and also you’ll need to make sure Freeway doesn’t transform any of the special characters (not sure if it will).


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On Jun 16, 2010, at 9:26 PM, Dirk wrote:

I’ve been trying to add empty spaces between some HTML text I’m
using as a menu but that is always stripped by the browser.

I searched a bit and found that by using the “pre” tag I should be
able to solve this issue. However, it doesn’t really work as I
thought it would because now the text baseline is shifted down about
8px and distorting my layout. What is the trick to achieve what I
want?

Example:
Instead of “Menu1 | Menu2”
I’d like to see “Menu1 | Menu2”

This is easy to do and no pre tag needed. If your using a list for
your menu (ul or dl, for example) - a good idea, btw - I would use a
right margin for each list/menu item to achieve the spacing you want.
And if you’re using graphic images for links, which you’re not, you
could define a width for each link then use margins to space things
out. Something to keep in mind if you ever use graphic menu buttons in
this manner.

Here’s a very basic css example using a list:

ul li a {
	margin-right: 8px;
}

This gives each link a right margin which would give you what you want
above.

Todd


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Dan, Todd, thanks for your replies.

When I saw my post I just realized that the four spaces I used before and after the pipe symbol were also stripped. Sorry, I didn’t know/realize this would happen.

I believe Dan’s reply is what I’m looking for and I’m trying it out now to see if it works. In the original example, what I wanted was for the menu to look like “Menu1    |    Menu2” instead of “Menu1 | Menu2”

Regards,
Dirk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

How about using css display: inline-block and add some padding for the spacing on either side of the pipe.

Here’s a sample http://freshbrand.com/STUFF/NavSpacing/

THE FW5 Pro file is here - http://freshbrand.com/STUFF/NavSpacing.zip


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you do use:

display: inline-block

make sure you use the extended button for that CSS style and add in:

zoom: 1;
*display: inline;

for IE7 or else it won’t look right.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi, I just got around to try what I read - and what I even tried here successfully - but it failed.

Entering “& nbsp;” (without the space and quotation marks) in some formatted HTML text on my web site simply printed as the text but not a space.

What am I doing wrong?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You need to simply type an Option-space in Freeway.   will be the
code that gets output when you do that. Option-space is the shortcut
in just about all Mac programs for the non-breaking space character.

Walter

On Jun 18, 2010, at 1:28 PM, Dirk wrote:

Hi, I just got around to try what I read - and what I even tried
here successfully - but it failed.

Entering “& nbsp;” (without the space and quotation marks) in some
formatted HTML text on my web site simply printed as the text but
not a space.

What am I doing wrong?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

You need to simply type an Option-space in Freeway

And depending on your Keyboard setup/language that might be more familiar as Alt-Space

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks, got it! :slight_smile:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options