Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7

Thread: Font Sizes

  1. #1
    New Coder
    Join Date
    May 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Font Sizes

    I am wanting users to change the font size. I have a Javascript script, but I had been told it would be better to use CSS.

    Can anyone help me to achieve this please?

    Thanks in advance, and if I need to change anything, can you tell me because I am totally new to this coding thing.

  • #2
    Regular Coder
    Join Date
    May 2007
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi again colster , question... have you linux or windows hosting?
    Forum for webmasters and developers
    http://www.htmlfrenzy.com
    Are you an IT expert? Join our Reward system
    www.htmlfrenzy.com/reward-system.php

  • #3
    New Coder
    Join Date
    May 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, I havent got any hosting as of yet, because I cannot afford, but I will be getting Windows Hosting.

  • #4
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Quote Originally Posted by smalldog
    question... have you linux or windows hosting?
    What does that have to do with anything?

    @thecolster123
    You can't use CSS to change stuff. You need to use JavaScript for that. HTML defines the page structure, CSS the design (ie colors, widths, backgrounds etc) and Javascript the behavior (any actions the site performs).

    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION

  • #5
    Regular Coder
    Join Date
    May 2007
    Posts
    118
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, never mind.. But, I suggest you rather linux hosting, there will be running PHP and I think PHP is better / easier to learn .. And now about the font size.. do you use any CSS in your HTML? I mean.. external with something like this

    <link rel="stylesheet" type="text/css" href="main.css">

    or embedded something like this...
    <style>
    body {
    font-size: ....;
    ...
    }
    </style>

    If you are using embedded, save it as css file and define the external definiton rather.. then name the css file after the font size what you want.. for example in

    small.css
    you have:
    body {
    font-size:9px;
    ...
    }

    medium.css
    you have:
    body {
    font-size:13px;
    ...
    }

    large.css
    you have:
    body {
    font-size:20px;
    ...
    }

    And then just link from all your sites to target definition file for example

    <link rel="stylesheet" type="text/css" href="small.css"> or
    <link rel="stylesheet" type="text/css" href="medium.css">

    And that value small/medium/large will be read dynamically from cookie like this...

    Code:
    <?php if ($_COOKIE['fontsize']=='small') || ($_COOKIE['fontsize']=='medium') || ($_COOKIE['fontsize']=='large')
    echo '<link rel="stylesheet" type="text/css" href="'.$_COOKIE['fontsize']'.css">';
    else echo '<link rel="stylesheet" type="text/css" href="medium.css">';
    ?>
    And the last step is store the value in the cookie, you can do it from javascript or from PHP that's better.. I can help you with that later if you want, when you will be running your hosting...
    Last edited by smalldog; 05-11-2007 at 04:54 PM.
    Forum for webmasters and developers
    http://www.htmlfrenzy.com
    Are you an IT expert? Join our Reward system
    www.htmlfrenzy.com/reward-system.php

  • #6
    New Coder
    Join Date
    May 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    right, okay.. thanks for your help. When i get hosting, which should be around July/August, I will come back for help.

    Thanks for all that came and helped me. Much apreciated.

  • #7
    Regular Coder kewlceo's Avatar
    Join Date
    Mar 2006
    Location
    California, US
    Posts
    484
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Here's a good article on dynamically resizing fonts: http://alistapart.com/articles/fontresizing
    UBERHOST.NET
    Shared, reseller, semidedicated hosting and dedicated server plans.
    DirectAdmin • Installatron • Money-Back Guarantee • 24/7 Support
    Providing "Service Above All Else" since 2005.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •