csc 넘치는 text

Js & Css 2009. 5. 21. 17:54 posted by 무명시인
 

스타일로 길이 자르기

그냥 가나다라마바사아자차카타파하
Css 가나다라마바사아자차카타파하

Css2 가나다라마바사아자차카타파하

긴글 자동 줄바꿈
긴텍스트텍스트텍스트텍스트텍스트텍스트텍스트텍스트텍스트텍스트텍스트텍스트텍스트

CodeHighLight - SyntaxHighlighter 2.0 사용하기

Js & Css 2009. 5. 18. 16:36 posted by 무명시인




http://code.google.com/p/syntaxhighlighter/

첨부파일을 다운받는다..

13개의  .js 파일과

1개의 .css 와

1개의 .swf 파일이 있다.


사용자 삽입 이미지

각각 인클루드를 하고..

사용법은 쉽다..

       <pre name="code" class="c-sharp">
        using System;
        using System.Collections.Generic;
        using System.Linq;
        using System.Web;
        using System.Web.UI;
        using System.Web.UI.WebControls;

        public partial class CodeHighLight_Test : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {

            }
        }

        </pre>
        <hr />
        <pre name="code" class="c-sharp:collapse">
        using System;
        using System.Collections.Generic;
        using System.Linq;
        using System.Web;
        using System.Web.UI;
        using System.Web.UI.WebControls;

        public partial class CodeHighLight_Test : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {

            }
        }

        </pre>
        <hr />
        <textarea name="code" class="c#" cols="60" rows="10">
        using System;
        using System.Collections.Generic;
        using System.Linq;
        using System.Web;
        using System.Web.UI;
        using System.Web.UI.WebControls;

        public partial class CodeHighLight_Test : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {

            }
        }

        </textarea>

사용자 삽입 이미지

컨태이너 역활을 할 html 태그에 class 를 해당 언어명으로 주면된다.

width 는 태이블로 감사서 주어야 한다 ..

웹에디터나 이런걸로 얼마든지 사용이 가능할것 같다.

TextArear 의 내용이많아지면..

Height 의 속성이 저절로 늘어난다..

힏들게 자바스크립트로 제어 할려고 하다가..

이런 쉬운 방법이..

Style 속성 지정만으로 해결이 되었네..

<textarea cols="20" rows="2" name="textarea1" style="overflow: visible"></textarea>

ASP.NET 의 서버컨트롤도 동일하게 적용이 가능하다.

<asp:TextBox runat="server" ID="TextBox1" Style="overflow: visible;" TextMode="MultiLine"></asp:TextBox>