Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text vertical instead of horizontal

Status
Not open for further replies.

gwar2k1

Programmer
Apr 17, 2003
387
GB
Hey, just wondered how i could get text to be written up (or down) a vertical space using html / css.

Thanks

~*Gwar3k1*~
"To the pressure, everything's just like: an illusion. I'll be losing you before long..."
 
Do you mean like this?

H
e
l
l
o

W
o
r
l
d

Or where the letters are actually flipped sideways? I can dig up a solution to either way, just let me know--the second way is IE only.

Rick

-----------------------------------------------------------
RISTMO Designs
Arab Church
Reference Guides
 
Or maybe like this:

Code:
<img src=&quot;SidewaysO.gif&quot; alt=&quot;O&quot; height=&quot;15&quot; width=&quot;10&quot;></img><br /><img src=&quot;SidewaysL.gif&quot; alt=&quot;L&quot; height=&quot;15&quot; width=&quot;10&quot;></img><br /><img src=&quot;SidewaysL.gif&quot; alt=&quot;L&quot; height=&quot;15&quot; width=&quot;10&quot;></img><br /><img src=&quot;SidewaysE.gif&quot; alt=&quot;E&quot; height=&quot;15&quot; width=&quot;10&quot;></img><br /><img src=&quot;SidewaysH.gif&quot; alt=&quot;H&quot; height=&quot;15&quot; width=&quot;10&quot;></img>

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Hi mate,

<html>
<head>
<style>
#vertit {
position: absolute;
left: 150px;
top: 150px;
writing-mode: tb-rl;
filter: flipv fliph;
}
</style>
</head>
<body>
<div id=&quot;vertit&quot;>Test</div>
</body>
</html>

This is IE only though.

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
True, but a single image would be easier then....unless you used javascript:

<script type=&quot;text/JavaScript&quot;>
<!--
var A='<img src=&quot;SidewaysA.gif&quot; alt=&quot;A&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
var B='<img src=&quot;SidewaysB.gif&quot; alt=&quot;B&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
var C='<img src=&quot;SidewaysC.gif&quot; alt=&quot;C&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
var D='<img src=&quot;SidewaysD.gif&quot; alt=&quot;D&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
var E='<img src=&quot;SidewaysE.gif&quot; alt=&quot;E&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
var F='<img src=&quot;SidewaysF.gif&quot; alt=&quot;F&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
var G='<img src=&quot;SidewaysG.gif&quot; alt=&quot;G&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
var H='<img src=&quot;SidewaysH.gif&quot; alt=&quot;H&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
//etc....
var L='<img src=&quot;SidewaysL.gif&quot; alt=&quot;L&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
//...
var O='<img src=&quot;SidewaysO.gif&quot; alt=&quot;O&quot; height=&quot;15&quot; width=&quot;10&quot;><br>';
//....

document.write(h+e+l+l+o);
//-->
</script>

Rick
P.S. I've never heard of </img>! Or maybe I have...a long time ago....but I thought it was <img /> that was supposed to be used? </img> is XHTML Standard?

-----------------------------------------------------------
RISTMO Designs
Arab Church
Reference Guides
 
Code:
</img>
is a standard XHTML closing tag.

Every tag requires a closing tag:
Code:
<img></img>
,
Code:
<br></br>
,
Code:
<input></input>
, but for some tags, you can &quot;cheat&quot; and combine the closing and opening tags into one sequence:
Code:
<br />
,
Code:
<hr />
, etc.

I try to do an opening + closing pair to assist in eye-reading, but I can't seem to train myself to do it with
Code:
<br />
, probably because I just think of it to much as a single line-return character.

Rick, would your code work, or should it be a caps call:
Code:
document.write(H+E+L+L+O);

You know, using that scheme, a person could write a script that would parse pages sideways. Very funny trick, that!

Cheers,


[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
Sorry...you're right...JavaScript is case-sensitive. It should have been document.write(H+E+L+L+O);. It seemed like something was wrong, but it was too late to think clearly! ;-)

Rick

-----------------------------------------------------------
RISTMO Designs
Arab Church
Reference Guides
 
Yeah the letters flipped ;) thanks for all your replies im gonna try the none-image ones first.



~*Gwar3k1*~
&quot;To the pressure, everything's just like: an illusion. I'll be losing you before long...&quot;
 
hey, Wullie, ur example didnt work =( Im using IE 6.1 and it just showed up as normal. I added type=&quot;text/css&quot; but that had no effect either.

Suggestions?

~*Gwar3k1*~
&quot;To the pressure, everything's just like: an illusion. I'll be losing you before long...&quot;
 
its quite easy to do this with PHP, you can use php with the GDlib to make on the run graphics with fonts in. that way the programming automatically makes the flipped over fonts and puts them in the browser, as this is just done with jpgs or pngs it works on all browsers anywhere,

I learned a bit yesterday, today i learned a lot, imagine what i'll learn tomorrow!
 
i really dont wanna use images. surely it'll make the page load slower etc.
I was hoping for a CSS property or something like that which Wullie did suggest, though it's not working in my browser (IE6.1) and I dunno if it will on other ppls. I know I should test in other browsers, but my target audience isnt exactly the type to have anything but IE so if its not working on mine, its not working on theres ;)

~*Gwar3k1*~
&quot;To the pressure, everything's just like: an illusion. I'll be losing you before long...&quot;
 
If you use Edward's and my method, it will not be terribly slow, because once the images are called once, they will be reused over and over again, and each letter, in 12px font, would only be about 70bytes each.

Rick

-----------------------------------------------------------
RISTMO Designs
Arab Church
Reference Guides
 
nm, thanks all! i got rid of the div and used a cell with class vrtit. thus further supports my argument div is annoying and pointless. <span> is more favorable to me though where avoidable I use neither!
mwuhahahaha

~*Gwar3k1*~
&quot;To the pressure, everything's just like: an illusion. I'll be losing you before long...&quot;
 
gwar2k1: i really dont wanna use images. surely it'll make the page load slower etc.

You're forcing a web page to rotate text sideways, making it a pain in the bazoom to read and you're worried about throughput? [rofl]

Cheers,



[monkey] Edward [monkey]

&quot;Cut a hole in the door. Hang a flap. Criminy, why didn't I think of this earlier?!&quot; -- inventor of the cat door
 
<style>
.vertit {
writing-mode: tb-rl;
filter: flipv fliph;
}
</style>
yes, this is good.. but when u print this, option filter is not executed...
text is mirrored
 
Thanks for the heads up =)

and... ive come off my little anti-div trip. Ive started using them (not through choice) and they are actually... infact... awesome. *hangs head in shame*

~*Gwar3k1*~
&quot;To the pressure, everything's just like: an illusion. I'll be losing you before long...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top