Author Topic: OT - Some HTML help  (Read 1310 times)

0 Members and 1 Guest are viewing this topic.

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
OT - Some HTML help
I'm wondering if there's any way to set a width - say, in pixels - beyond which a page element (paragraph of text, DIV, whatever) will not expand. But at the same time if the browser window is too narrow to display that paragraph at a full width, it will word wrap the text instead of displaying a horizontal scrollbar at the bottom of the window.

For example: I want to have my paragraph text word-wrap at 700 pixels, or less. I.E. If my browser window is 550 pixels wide, I want the text to word-wrap at the border of the window, not forcibly extend to 700 pixels. But if my browser is 1024 pixels wide, I want the text to wrap at its set maximum of 700 pixels width.

Any ideas?
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline an0n

  • Banned again
  • 211
  • Emo Hunter
    • http://nodewar.penguinbomb.com/forum
I think there's a margin tag or something that sets the max edge of the text but I can't remember the code/tags for it.
"I.....don't.....CARE!!!!!" ---- an0n
"an0n's right. He's crazy, an asshole, not to be trusted, rarely to be taken seriously, and never to be allowed near your mother. But, he's got a knack for being right. In the worst possible way he can find." ---- Yuppygoat
~-=~!@!~=-~ : Nodewar.com

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by an0n
I think there's a margin tag or something that sets the max edge of the text but I can't remember the code/tags for it.


Nope - margin is a style sheet property which defines how much white space to leave on a given side.
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline an0n

  • Banned again
  • 211
  • Emo Hunter
    • http://nodewar.penguinbomb.com/forum
Make everything nice and normal with the text word-wrapping all the time, then place a big transparent gif in the background that's the width you want the page to start scrolling at. Then when the window edge hits the image it'll start scrolling.

Or you could use Javascript to get the tags to change, like:

If screenwidth<200, < div width=199 >
else
< div width=90% >
« Last Edit: July 16, 2002, 08:15:00 pm by 397 »
"I.....don't.....CARE!!!!!" ---- an0n
"an0n's right. He's crazy, an asshole, not to be trusted, rarely to be taken seriously, and never to be allowed near your mother. But, he's got a knack for being right. In the worst possible way he can find." ---- Yuppygoat
~-=~!@!~=-~ : Nodewar.com

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
Quote
Originally posted by an0n
Make everything nice and normal with the text word-wrapping all the time, then place a big transparent gif in the background that's the width you want the page to start scrolling at. Then when the window edge hits the image it'll start scrolling.

Or you could use Javascript to get the tags to change, like:

If screenwidth<200, < div width=199 >
else
< div width=90% >


Nice idea, but I think you misunderstood. At no point do I want the window to scroll horizontally. I want the text to take up as much room as it has available, even if it'ss only 25 pixels of width, up until a certain width.

The reason for this is that when lines of text are too long, they can get to be hard to read. So I want to limit the width that the text will expand to.
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill

 

Offline an0n

  • Banned again
  • 211
  • Emo Hunter
    • http://nodewar.penguinbomb.com/forum
Yeah, well it's the same just using screenwidth>200.
"I.....don't.....CARE!!!!!" ---- an0n
"an0n's right. He's crazy, an asshole, not to be trusted, rarely to be taken seriously, and never to be allowed near your mother. But, he's got a knack for being right. In the worst possible way he can find." ---- Yuppygoat
~-=~!@!~=-~ : Nodewar.com

 

Offline Stealth

  • Braiiins...
  • 211
i don't get what you're trying to say... if it's what you want is for the writing/movie/etc. to be against the side of the screen without a half-inch or so 'border'... (this is quite common when exporting Flash SWF files)

in the body of the html add this to the body tag:
MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0"


--------------
(If this involves flash):
In the publish settings use 100% for both width and height instead of WIDTH=700 HEIGHT=520
and
--------------


if you say you want it to scroll instead of word wrap i'm not sure cause i can't see exactly, but try putting "scrolling=yes" in the 'body' tag...
« Last Edit: July 16, 2002, 11:10:21 pm by 594 »

 

Offline an0n

  • Banned again
  • 211
  • Emo Hunter
    • http://nodewar.penguinbomb.com/forum
Haha, they forgot to disable the td tags.

Anyway. Doesn't using div's do what you want?
"I.....don't.....CARE!!!!!" ---- an0n
"an0n's right. He's crazy, an asshole, not to be trusted, rarely to be taken seriously, and never to be allowed near your mother. But, he's got a knack for being right. In the worst possible way he can find." ---- Yuppygoat
~-=~!@!~=-~ : Nodewar.com

  

Offline Stealth

  • Braiiins...
  • 211
div tags should do it, if they don't, then try my method... i'm not exactly sure what it is you want though

 

Offline Sandwich

  • Got Screen?
  • 213
    • Skype
    • Steam
    • Twitter
    • Brainzipper
No, none of those works - I've tried. A script could work; essentially what I'm looking at is something like this (this will probably come out as some sort of weird combo of PHP and Javascript... :p):

Code: [Select]

if (window.width <= 500px) {
    text.width = 100%;
} elseif (window.width > 500px) {
    text.width = 500px;
}


So when the text is in a smaller window, it will flow out to the border, and when the window is wider than a certain size, the text will only expand to that size.
SERIOUSLY...! | {The Sandvich Bar} - Rhino-FS2 Tutorial | CapShip Turret Upgrade | The Complete FS2 Ship List | System Background Package

"...The quintessential quality of our age is that of dreams coming true. Just think of it. For centuries we have dreamt of flying; recently we made that come true: we have always hankered for speed; now we have speeds greater than we can stand: we wanted to speak to far parts of the Earth; we can: we wanted to explore the sea bottom; we have: and so  on, and so on: and, too, we wanted the power to smash our enemies utterly; we have it. If we had truly wanted peace, we should have had that as well. But true peace has never been one of the genuine dreams - we have got little further than preaching against war in order to appease our consciences. The truly wishful dreams, the many-minded dreams are now irresistible - they become facts." - 'The Outward Urge' by John Wyndham

"The very essence of tolerance rests on the fact that we have to be intolerant of intolerance. Stretching right back to Kant, through the Frankfurt School and up to today, liberalism means that we can do anything we like as long as we don't hurt others. This means that if we are tolerant of others' intolerance - especially when that intolerance is a call for genocide - then all we are doing is allowing that intolerance to flourish, and allowing the violence that will spring from that intolerance to continue unabated." - Bren Carlill