开发者

Aligning text to checkbox, can't seem to get it to align properly?

开发者 https://www.devze.com 2023-04-11 03:00 出处:网络
I\'m attempting to align the text next to the checkbox on this page, however I can\'t seem to get it to work:

I'm attempting to align the text next to the checkbox on this page, however I can't seem to get it to work:

Here's a link to the jsFiddle: http://jsfiddle.net/Cbmnf/8/

What I've tried:

  • Wrapping the text in a selector called #blank_referrer .text then;
    • Applying a negative margin-top and padding-top.
    • Applying float: left; on both the checkbox and text selector, which completely ruined the display.
    • Applying display: inline-block;.
    • Applying line-height: 13px (the height of the font) to #blank_referrer.

It's really annoying me that the checkbox isn't vertically aligned to 开发者_开发技巧the centre of the capital "T" in the text.

Any edits, answers, advice would be greatly appreciated!


Try the following CSS definition:

#blank_referrer input[type="checkbox"] {
   display: block;
   margin: 1px 4px 0 0;
   float: left;
}

You can now tinker with the margin-top setting to get the look you want...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号