Challenging highlight style ;-)

Screen_shot_2011-03-30_at_15

13 Responses

  1. Shaun Inman Shaun Inman

    Totally doable (assuming this is markup highlight via <em> or <strong> rather than user selection). Just set a tileable bg image then use before:/after: to generate an element to use for your caps (also bg image). :)

    about 2 years ago

  2. Paul Annett Paul Annett

    But if it happens to span multiple lines?

    about 2 years ago

  3. Shaun Inman Shaun Inman

    Not sure about that. Might still work if the bg image height is the same as the line-height and you use display: inline-block; for the highlight element (although that might prevent the wrapping).

    Of course, I'm doing what I loath: recommending a solution I don't absolutely know to work.

    about 2 years ago

  4. Andy Hume Andy Hume

    You've posted this here so someone solves it, right? ;)

    about 2 years ago

  5. Matthew Pennell Matthew Pennell

    I've done something similar with padded background colours on the banner on the activehotels.com homepage. Sure it could be adapted to use images instead.

    about 2 years ago

  6. Paul Annett Paul Annett

    @partiallyblind is sat next to me, virtually telling me he's sorted it and I have to try harder to stump him. He has thrown down the gauntlet! ;-)

    about 2 years ago

  7. Rich Quick Rich Quick

    If it spans multiple lines should be doable .. make it a PNG with transparency. Might need an extra element to wrap a LHS border on it .. could be done I think.

    about 2 years ago

  8. Drew McLellan Drew McLellan

    Wait, alcohol affects my ability to drive?

    WHY DID NOBODY TELL ME THIS?

    likes

    about 2 years ago

  9. Cole Henley Cole Henley

    Easily achieved if inline or inline-block?

    about 2 years ago

  10. Cole Henley Cole Henley

    not the easiest on the eye but in principle this example will work in most browsers (not IE 7 and earlier): http://dl.dropbox.com/u/58678/experiments/highlighter/index.html

    about 2 years ago

  11. Paul Annett Paul Annett

    Drew – who said anything about alcohol? This is for the page about ohol.

    Cole – great! Except the ends of each line need to not be cut off. Anyway, no worries as our devs have it sorted ;-) Thanks tho!

    about 2 years ago

  12. Daniel Chatfield Daniel Chatfield

    Care to share what the devs came up with.

    almost 2 years ago

  13. Daniel Chatfield Daniel Chatfield

    Found it on the prototype site - unfortunately I can't use that as I don't know the width of the box.

    almost 2 years ago

keyboard shortcuts: previous shot next shot L or F like