Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / HTML, CSS, Scripts / HTML / July 2008



Tip: Looking for answers? Try searching our database.

set size of body in pixels

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rick Merrill - 28 Jul 2008 00:03 GMT
I need  a web page in exact
pixels height and width for use
in standard def TV.

Any ideas how?
dorayme - 28 Jul 2008 00:21 GMT
> I need  a web page in exact
> pixels height and width for use
> in standard def TV.
>
> Any ideas how?

Well, what is the problem exactly? Do you now CSS a bit?

Signature

dorayme

Rick Merrill - 28 Jul 2008 12:22 GMT
>> I need  a web page in exact
>> pixels height and width for use
[quoted text clipped - 3 lines]
>
> Well, what is the problem exactly? Do you know CSS a bit?

720x480
Yes I do.
Scott Bryce - 28 Jul 2008 15:09 GMT
> I need  a web page in exact pixels height and width for use in
> standard def TV.

> Any ideas how?

<snip>

> 720x480.

Controlling the width using CSS is a simple matter. Controlling the
height is not. You can specify a height for a div, but constraining the
content of the div to that height is not as easy. Even if you specify a
font face and size and mark them !important, different browsers render
text differently. This means that they will wrap text at different
points. What may look like 10 lines of text to you may look like 11
lines of text to me, and not fit in the div.

You have several options: deliver each page as a 720 x 480 bitmap,
constrain the width to 720px and allow the page to overflow the height,
constrain the width to 720px and hide anything that overflows, constrain
the width to 720px and put so little content on the page that it is
unlikely to overflow. I don't think any of these are what you really want.
Rick Merrill - 29 Jul 2008 01:06 GMT
>> I need  a web page in exact pixels height and width for use in
>> standard def TV.
[quoted text clipped - 18 lines]
> the width to 720px and put so little content on the page that it is
> unlikely to overflow. I don't think any of these are what you really want.

Thanks.  The following seems to work, but now how do I get the word wrap
to a different place than the left margin???
|left  |wrapped text

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">body { height: 480px; width: 720px; padding-left:
100px; background-image: url('Database.jpg');
background-position: 200%; background-repeat: repeat;}</style>
<title>Ch 10 ...
Scott Bryce - 29 Jul 2008 02:11 GMT
> Thanks.  The following seems to work,

No, it doesn't.

> but now how do I get the word wrap to a different place than the left
> margin??? |left  |wrapped text

That is what margin: is for in the style sheet.

> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
> <html><head> <meta http-equiv="Content-Type" content="text/html;
> charset=ISO-8859-1"> <style type="text/css">body { height: 480px;
> width: 720px; padding-left: 100px; background-image:
> url('Database.jpg'); background-position: 200%; background-repeat:
> repeat;}</style> <title>Ch 10 ...

What you have here does not do what you want it to do. It is not a good
start. Things will get messy fast. You are also failing to address
things that will cause the content to be longer for some people than for
others. Trying to control the height of a page really is problematic.

You don't specify a font. Or a font size. And what if I don't have the
font you specify? What if the font my browser uses is slightly larger
than the one you specify. It doesn't have to be taller. It could be
wider, which could change the number of lines the text takes up.

Maybe it would help to understand WHY you want to constrain the page to
720px x 480px.
Rick Merrill - 29 Jul 2008 15:50 GMT
>> Thanks.  The following seems to work,
>
[quoted text clipped - 24 lines]
> Maybe it would help to understand WHY you want to constrain the page to
> 720px x 480px.

This is a piece of a 2-week long listing of tv shows
 with javascript that
finds the current time and only displays a
screenfull of what is playing
now and in the next couple of hours.
The html/javascript is run periodicly
by a frequent, scheduled batch file to
produce a graphic image that
is put on the TV as 'filler' before
the next show.  that's why.

In other words, this html is a convenient way
to generate the graphics in a semi-automatic fashion.

I have put "margin" into CSS but but ... it doesn't yet pass w3c...

Thanks for the hints.
Scott Bryce - 29 Jul 2008 17:21 GMT
> This is a piece of a 2-week long listing of tv shows with javascript
> that finds the current time and only displays a screenfull of what is
[quoted text clipped - 5 lines]
> In other words, this html is a convenient way to generate the
> graphics in a semi-automatic fashion.

I would think that HTML/Javascript would be a less than optimum way to
do this.

If I am understanding correctly, what you are trying to do is use HTML
to describe an image to a program that will generate the image, then the
resulting image is displayed on a TV screen. Is that right? There may be
better ways of doing this, though we tend to use the tools we are
familiar with.

If I am correct, then the peculiarities of different browsers is not as
big an issue as it usually would be with HTML. But you still need to
manage the height of your content in some way.

Rather than trying to set the width and height of the body of the page,
place a div around your content and set the width, height, background
image, font face, font size, margins, etc of the div.

You might have better success with a program like Fly.
http://martin.gleeson.com/fly/
(Maybe. Fly won't automatically do word wrapping for you.)
Rick Merrill - 29 Jul 2008 22:02 GMT
>> This is a piece of a 2-week long listing of tv shows with javascript
>> that finds the current time and only displays a screenfull of what is
[quoted text clipped - 26 lines]
> http://martin.gleeson.com/fly/
> (Maybe. Fly won't automatically do word wrapping for you.)

I'll give the div  a try.

This of course evolved from a nice, use anywhere, web page with the
NowPlaying feature, then it became a path to getting an anouncement
slide on the tv.
Adrienne Boswell - 28 Jul 2008 00:23 GMT
Gazing into my crystal ball I observed Rick Merrill
<rick0.merrill@gmail.com> writing in news:d5SdnY-LuvE-
YxHVnZ2dnUVZ_vadnZ2d@comcast.com:

> I need  a web page in exact
> pixels height and width for use
> in standard def TV.
>
> Any ideas how?

You really don't need to do that, just let the browser deal with it.  
You might want to use @media tv - which is intended for television and
television type devices.

Television screen are as varied as computer monitors.  Additionally, you
don't know if someone is going to have their cable menu open, or using
picture in picture or something like that, which could reduce the
available "window" size.

Again, just let the browser deal with it.

Signature

Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Andy Dingley - 28 Jul 2008 17:45 GMT
> I need  a web page in exact
> pixels height and width for use
> in standard def TV.

You don't.

Provide a fluid design, same as ever. View it on a browser that
imposes this rigid size limit (such as 720×480) and your design will
cope.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.