Page 1 of 4 123 ... LastLast
Results 1 to 10 of 35

Thread: css size not right -- should be easy fix

  1. #1
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default css size not right -- should be easy fix

    hey, guys. my friend wrote up some css for a page on our site, and it worked fine. It was supposed to mimic that of another page... and it did. i'm using php to totally automate the entire section of the site, so I need the css to autoformat, instead of the manual stuff we had before.
    So... i'm also using it on another page, a search page. for some reason, the size is just off.

    http://thebrb.com/stockpile/search.php
    ^should be fixed here.

    http://www.thebrb.com/stockpile/tuto...muzzleflashes/
    ^should look like this. this isn't using the css though.


    Code:
    ...<style type="text/css">
    a {color: #FF0000;
    font-size:10pt;
    font-weight:bold;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    letter-spacing:0px;
    text-decoration: underline;}
    body {
    color: #3A4F6C;
    font-size:7.5pt;
    font-weight:bold;
    font-family:Verdana, Arial, Helvetica, sans-serif;
    letter-spacing:0px;
    } 
    </style>...
    this is just in the page, not a seperate file, but I will seperate later.


    Anyway.... what's with the size being off? I just need to be able to have csss automatically make the text look like the blue-green text on the second page. I also need to be able to have the headers and such set easily (<h1>text</hi> or whatever).

    I'm sure this is obvious to someone who knows css... i just don't. Sorry for asking a stupid question

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    "just" off? The text on the first page is about twice the size of the text on the second page, at the resolution I have on this laptop. It's very noticeable, because the text on the second page is nigh on unreadable if I don't increase the text size.

    Anyway... on the first page, you're using pt (points); on the second one, you're using px (pixels). There's a big difference, but neither should be used for text size. Pixels can't be (or shouldn't be able to be, technically if not practically [the one time IE does things properly, it makes things harder for users... gah]) resized, whereas points are meant for printable media and have highly variable sizes onscreen (I think; search for the post in question, it was one of Mike's and I don't remember it too clearly [not to criticize your writing ability, Mike]).

    Wow, I've used far too many brackets in this post.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    just as in simply. Yeah, it's way off.

    Hmm... alright.

    I'll look into that then.

    Again, I didn't write it... maybe I should just try my own version.... we'll see.

    thanks.

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey
    whereas points are meant for printable media and have highly variable sizes onscreen
    The point unit is defined in inches (1/72th), and heralds from print media. Look at your word processor; what's its unit for font sizes? It'll either be points (pt) or picas (pc), and there are 12pt to 1pc.

    Though it's possible to convert an absolute unit, like millimeters, inches, or points, to something more meaningful for a monitor, systems aren't usually calibrated properly (or so I'm led to believe).

    When it comes to pixels, there's a similar problem. The resolution of a particular monitor might be very high. For example, laptops with 15 inch displays can have pixel densities as high as 133ppi. This 17 inch monitor has a pixel density of only 84ppi at its current resolution. The difference means that something 12px in length will be about 3.5mm here, but on that high-resolution display, it will be less than 2.25mm. That's approximately 60% of the size, and equivalent to 7px. If this something was text, it would be quite unreadable.

    not to criticize your writing ability, Mike


    Wow, I've used far too many brackets in this post.
    Yes. Yes, you have.

    Mike

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    Hmm.... I just was playing around with the page for another thing, error testing and such... I ended up outputting some text before the layout of the page, and it was sized correctly.

    I'm guessing this means that since the layout is all in tables.... that the text is doing something different than the code tells it to because its not body text, but rather that of a table.

    Am I on to something?

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I've given you the answer.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    I've heard your answer... and I will figure that out.
    But... when this is applied to my pages, it works if the text isn't in a table, and doesn't work if it is in one.
    Isn't there some special thing in CSS that is for text within tables?

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well, your test page doesn't work any more.
    But no, there's no reason a text size applied to a parent element won't work in a child, unless the property is overridden somewhere down the document tree.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    Hmm.... ok.

    I'll try a new test page then. I'm reworking that... trying to get it perfected... big project.

    Anyway... let's see...

    http://thebrb.com/stockpile/fix/index.php?act=test

    There... same code for each... nothing special, I don't think...

    It's generated by php, but the browser doesn't care about that.... so.... yeah.

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Looks correctly-sized to me.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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