The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Aligning text question

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #34244


    I’m trying to write a bit of CSS and while I know a fair bit now (not a total beginner) there’s still a lot I don’t know and I hoped I could get some help on a (hopefully!) simple question.

    Basically – I have the text “Best NEW price: £12.00” (as an example) where the “£12” is in a bigger font. What I want is for it all to be aligned centrally along the line, but instead it’s all at the bottom of the line – what I want is for the “Best NEW price:” bit to be raised up a bit so its center is the same as the center of the “£12”.

    Here’s what I have so far:

    What’s the best way in CSS to ensure the center of all the text is on the same line?


    I’d love to have a look but jsFiddle is currently down. I am guessing that using line-height will fix the problem though.


    I couldn’t get line-height to do anything.. this will look bad with multipline lines of text, but hey:


    Thanks for that! That’s really helped! I’m still getting to grips with CSS and it’s little things like that that I can spend hours on trying to figure out! Also, when I have managed to get a solution it’s probably not the best way, so it’s really helpful to hear how more experienced designers do it.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.