English 中文(简体)
案文定位与内线24小时div
原标题:Positioning of text relative to inline-block div
  • 时间:2011-10-15 16:42:01
  •  标签:
  • html
  • css

我对案文的位置问题表示怀疑,因为案文对准时钟的权利。 http://jsfiddle.net/lexy02/6CtT8/“rel=“nofollow”>jsfiddle,表明这一问题。

这里是“超文本”/CSS:

传真

Select Date:
<div class="inputblock">
    <input type="radio" name="dateselect" value="0" />Todays Date<br />
    <input type="radio" name="dateselect" value="1" />Another Date
</div>

CSS

.inputblock {
    display:inline-block;
    background-color:#DDD;
}

我想要的是,案文放在无线电台的左侧,上面说的是选择日期,然后排在四位顶端,而不是在底层。 我如何能够做到这一点? 我是否必须把标签一分为二?

I would appreciate any advice with this issue.

最佳回答

所有有线性元素的儿童都可以通过<条码>垂直定位:top。 CSS 财产。

因此,贵国社会保障局需要一个额外项目:

.inputblock {
    display:inline-block;
    background-color:#DDD;
    vertical-align: top;
}

http://jsfiddle.net/6CtT8/1/“rel=“nofollow” http://jsfiddle.net/6CtT8/1/。

问题回答

If you wrap both the label and the inputblock in a div and set vertical-align: top on that div you get what you want like this:

<div style="vertical-align:top;">
    Select Date:
    <div class="inputblock">
        <input type="radio" name="dateselect" value="0" />Todays Date<br />
        <input type="radio" name="dateselect" value="1" />Another Date
    </div>
</div>

Not sure if there s a better way using negative margins and relative positioning.

http://www.ohchr.org。 这对我来说是好的:

.inputblock {
    display:inline-block;
    background-color:#DDD;
    vertical-align: top;
}




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签