Search code examples
htmlcssfontsalignment

Vertically align two pieces of text with different font-sizes using CSS


At the top of my page I want to have the title of the page aligned to the left of the screen with a short nav menu aligned to the right of the screen. I can achieve this using float but the two elements have different baslines i.e. the baseline of the text appears different. Is there any way to get this to work using css? I have a sample of what I'm trying to do up on jsfiddle http://jsfiddle.net/nBPCG/63/


Solution

  • Hi you can use display:inline-block in your h1

    or see the Fiddle:- http://jsfiddle.net/nBPCG/101/