문제

I need to make following code stretchable with predefined height

<style>
.title{
   background: url(bg.gif) no-repeat bottom right;
   height: 25px;
}
</style>

<span class="title">This is title</span>

But since span is inline element, "height" property won't work.

I tried using div instead, but it will expand up to the width of upper element. And the width should be flexible.

Can anyone suggest any good solution for this?

Thanks in advance.

도움이 되었습니까?

해결책

Give it a display:inline-block in CSS - that should let it do what you want.
In terms of compatibility: IE6/7 will work with this, as quirks mode suggests:

IE 6/7 accepts the value only on elements with a natural display: inline.

다른 팁

SharePoint에는 사용자 프로필 동기화 서비스가 있습니다.SharePoint 사용자 프로필을 사용하여 AD 사용자 세부 정보를 동기화 할 수 있습니다.광고 및 사용자 프로필 속성에서 속성 간의 매핑을 구성 할 수 있습니다.일단 동기화를 구성하면 사용자의 속성에 액세스 할 수 있습니다.

이메일 만 보내 드리면, 사용자만으로도 동기화없이 작동 할 수 있습니다.

SharePoint 목록이있는 경우 이름 목록을 저장하기 위해 사용자 또는 그룹을 사용하는 것이 좋습니다.사용자 ID를 저장하지만 이름을 표시합니다.

이 필드 값에 액세스하고 서버 측 코드를 개발하는 경우 워크 플로우 또는 척추도 Sendmail 메서드를 사용하여 전자 메일을 보낼 수 있습니다.둘 다 전자 메일 주소를 지정할 필요가 없으며 사용자가 이메일을 보내주십시오.나는 그들이 사용자에게 직접 정보를 얻는 것을 가정합니다.

this is to make display:inline-block work in all browsers:

Quirkly enough, in IE (6/7) , if you trigger hasLayout with "zoom:1" and then set the display to inline, it behaves as an inline block.

.inline-block {
    display: inline-block;
    zoom: 1;
    *display: inline;
}

Assuming you don't want to make it a block element, then you might try:

.title  {
    display: inline-block; /* which allows you to set the height/width; but this isn't cross-browser, particularly as regards IE < 7 */
    line-height: 2em; /* or */
    padding-top: 1em;
    padding-bottom: 1em;
}

But the easiest solution is to simply treat the .title as a block-level element, and using the appropriate heading tags <h1> through <h6>.

span { display: table-cell; height: (your-height + px); vertical-align: middle; }

For spans to work like a table-cell (or any other element, for that matter), height must be specified. I've given spans a height, and they work just fine--but you must add height to get them to do what you want.

동일한 문제가 있습니다. 캘린더에서 올바른 날짜를 선택하면 유효성 검사 컨트롤이 상태를 업데이트하지 않습니다. 나는 JavaScript를 사용하고 onpickerfinish 메소드를 무시하고 솔루션을 발견했습니다.

페이지의 내용 :

<SharePoint:DateTimeControl ID="MyDateTimeControl" runat="server" DateOnly="true" />
<asp:CompareValidator ID="MyDateTimeControlCompareValidator" runat="server" ControlToValidate="MyDateTimeControl$MyDateTimeControlDate" 
Type="Date" Operator="DataTypeCheck" ErrorMessage="Please enter a valid date." />
.

자바 스크립트 부분 :

function OnPickerFinish(resultField) {
clickDatePicker(null, '', '');
// Ensuring that we are addressing the right DateTime control:
if (resultField.id == '<%= MyDateTimeControl.Controls[0].ClientID %>') {
    var valatorCtrl= document.getElementById('<%=MyDateTimeControlCompareValidator.ClientID%>');
    if (valatorCtrl != undefined && valatorCtrl.isvalid == false) {
        ValidatorEnable(valatorCtrl);
    }
}}
.

인터넷에서 여러 기사를 기반 으로이 솔루션을 만들었습니다.그러나 주요는 다음과 같습니다 : http : //www.meritsolutions.com/microsoft-sharepoint/managing-sharepointdatetime-control-events-from-client-side/

Why do you need a span in this case? If you want to style the height could you just use a div? You might try a div with display: inline, although that might have the same issue since you'd in effect be doing the same thing as a span.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top