Links in Opera

Discussion in 'CSS' started by Kuna, Jan 9, 2010.

  1. #1
    See how links went up. how to put them in middle


    [​IMG]
     
    Kuna, Jan 9, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    And how can I help you?
     
    s_ruben, Jan 11, 2010 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Oh, you mean in the middle (vertically) of the bar?

    You'll need to post your code first. Otherwise we can't tell you how to CHANGE your code to work.

    Though you can probably cheat and use line-height = the height of the menu bar.
     
    Stomme poes, Jan 12, 2010 IP
  4. Kuna

    Kuna Well-Known Member

    Messages:
    426
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #4
    line-height =1em; and it worked, what "em" means?
     
    Kuna, Jan 13, 2010 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    http://en.wikipedia.org/wiki/Em_(typography)

    Basically 1EM equals the current font-size. So if you say "font-size:14px;" then 1EM == 14px; - this is where the fun begins since if you say "font-size:0.8em" you get 80% of whatever the parent element's font size is... so

    
    <div style="font-size:32px;">
    	This text is 32px
    	<div style="font-size:0.5em;">
    		This text is 16px
    		<div style="font-size:0.5em;">
    			This text is 8px
    		</div>
    	</div>
    </div>
    
    Code (markup):
    You also have to watch out - line-height in some browsers is calculated fixed, so if you set font-size:14px; line-height:1.3em; then call font-size:24px, in some browsers you might find the lines of your text overlapping each-other becuase you didn't re-declare your line-height.

    Most people say EM is the width of a capitol M, which is where the term did originate, but these days it's a wee bit more arbitrary and it's usually safer to think of it as the distance between the baseline (the bottom of most capital letters) and the capsline (the top of most capital letters)... Especially since there's not a single 'standard' font for web use where font-size:14px will give you a 14px wide M.

    Which is why as a rule it's a bad idea to state a line height of 1EM and you are better off increasing it to like 1.2em or more. At 1EM some browsers in some fonts will 'chop off' ascenders and descenders on your characters (descenders are bits like the part on the letters y, g and p that go below the baseline), so you need to give a little extra room for those to render.
     
    Last edited: Jan 13, 2010
    deathshadow, Jan 13, 2010 IP