LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-26-2012, 10:24 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,545

Rep: Reputation: 235Reputation: 235Reputation: 235
html : force the fonts size for whole html page?


Hi,

I have a webpage that has different font sizes.

I need for my ebook a solution to read at a given size (medium).

I have a big html file to make it with a single font size.

Would you know if there is a html (basic code) trick to say at the beginning: please html use this given font size for whole html ?

thank you for any tips
 
Old 11-26-2012, 11:03 PM   #2
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
Some CSS perhaps? Add something like this in the <head> section of your HTML:

Code:
<style type="text/css">
body {
   font-size: 12px;
}
</style>
Modify the font size to your needs.
 
Old 11-26-2012, 11:14 PM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,545

Original Poster
Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by Diantre View Post
Some CSS perhaps? Add something like this in the <head> section of your HTML:

Code:
<style type="text/css">
body {
   font-size: 12px;
}
</style>
Modify the font size to your needs.

thank you ... I will try this evening..

I start my html pages with:

Code:
  
  echo '<head>' > "$TARGETFILE"
  echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'  >>   "$TARGETFILE"
 
Old 11-26-2012, 11:21 PM   #4
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 515

Rep: Reputation: 234Reputation: 234Reputation: 234
Yes, something like that. Just append the CSS to your $TARGETFILE before the closing </head> tag.
 
Old 11-26-2012, 11:22 PM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,545

Original Poster
Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by Diantre View Post
Yes, something like that. Just append the CSS to your $TARGETFILE before the closing </head> tag.
I hope that my ebook reader can understand css.. I must try.
 
Old 11-27-2012, 10:30 AM   #6
Xeratul
Senior Member
 
Registered: Jun 2006
Location: UNIX
Distribution: FreeBSD
Posts: 2,545

Original Poster
Rep: Reputation: 235Reputation: 235Reputation: 235
I have just tried with this at the beginning, but all fonts are not forced to a same single.
unfortunately

I have tried with explorer chromium, first. Seems not working, so highly probably wont work either with ebook reader.

Code:
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

<style type="text/css">
body {
   font-size: 12px;
}
</style>
</head>
...
 
Old 11-27-2012, 11:54 AM   #7
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,696

Rep: Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025
Maybe try with !important:
Code:
<style type="text/css">
body {
   font-size: 12px !important;
}
</style>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] HTML - how to force link to download txt file Michal Krzyz Programming 6 04-19-2012 05:07 PM
How do I output information from a PHP page to an HTML page? SentralOrigin Programming 3 01-10-2009 01:54 AM
LaTeX to HTML - all on one page jantman Linux - Software 1 12-03-2008 09:12 AM
html page maker prabhakar_kushwaha Linux - Software 3 10-14-2005 09:17 PM
HTML page break? patpawlowski Programming 4 02-12-2004 10:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration