This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes html restriction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "html restriction" Watch "html restriction" New topic
Author

html restriction

Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
are there a way that we have configure the html code so that it will look the same and print out the same regardless the user change the "text size" in browser? thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63039
    
  69

One way is to use CSS to set the font size. For example:

hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
thanks bear,
but where should I put it?
thanks!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63039
    
  69

Ah, never used CSS before? It's a very handy skill to get under your belt.
Easiest way to put it on a page is to place the CSS rule I posted earlier in style tags in the header:

But CSS is most useful when you put the rules in a .css file and use the link tag to include it in a page. That way, your rules are shared across all pages.
hth,
bear
a good CSS reference
recommended reading
Jackie Wang
Ranch Hand

Joined: Apr 18, 2002
Posts: 315
thanks bear,
are there a way that i can change the html code such that the default printing is "landscape" instead of "portrait"? thanks!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: html restriction
 
It's not a secret anymore!