1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Wrong font-size after adding a "universal selector" to my CSS file

Discussion in 'CSS' started by tayiper, Mar 24, 2007.

  1. #1
    Hey all, as the topic's title says, I am having a few issues with font-sizes after adding a "universal selector" to my CSS files; and yeah, this thread is a continuing of the previous The order of selectors in a stylesheet file one, in which member Dan Schulz said that he will check my wensite and then explain it all to me, but unfortunately he apparently forgot about it ...


    1. For instance, the "Enter the site's "intro.html" page by clicking this text ..." text/link on the: index.html page on one of my website-variants is not 20px anymore as it used to be (and as it should be/I want it to be) but 12px?? I only assume/speculate that this is because of the "12px font-size" being applied to "universal selector", am I right?? And if I am, how to aviod this unwanted behaviour??! Oh and yes, for styling this particular link I use "style" attribute with value "font-size: 20px;" that's applied inline to a start tag of an "a" element.


    2. Then I also noticed that now (i.e. with the "universal selector") any bolded links text's font-size (i.e. the links inside <strong>; although oddly this is not true for the emphasized text, i.e. the text inside <em> element) is 12px and not 10px as I've set it for "a" elements or hypertext links, again obviously as set by the "universal selector".


    3. And finally last but not least, similarly to the first problem described above (I think that here is too 12px vs. 10px), the font-sizes setting from most of the "span" classes (and IIRC "div" too; please see here: main.css, and here: root.css for the respective .css files) revert back to some obviously default big(ger) font-size; btw. I specified in pixels not in percents so that it shouldn't "add them up". For instance see the: intro.html page on my main 50webs variant, while for comparison look at the text "Copyright © Ivan Tadej Kandus. Some Rights Reserved." and "Disclaimer 1:" normally have smaller font-size as they should have. Is it maybe because these "span" classes are inside of the "table" elements??
    The two examples are the following ones:

    - the "sponsored links" text at the top (span class is "box")

    - the "This thing on the left is a simple Altavista's BabelFish translation script, ..." text at the bottom (span class is also "box")


    P.S. - And additionally I discovered some other strange things/quirks too, but luckily I mostly somehow managed to "get around them" one way or another!!


    thanks in advance, tayiper
     
    tayiper, Mar 24, 2007 IP
  2. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #2
    Font size is inherited. You have it set on body which is sufficient. Whatever gave you the idea it would be a good thing to do * {...}? Since removing that ruleset fixes the problem&#8212;you did try that, right? You didn't just suspect and post, did you?&#8212;why is it an issue? Just don't use the * selector for inherited properties.

    cheers,

    gary
     
    kk5st, Mar 24, 2007 IP
    tayiper likes this.