Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

HTML

              
                <div>
	<p>
		Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type
		<a href="#" title="Lorem Ipsum is simply dummy text of the printing and typesetting industry.">specimen book.</a>
		It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged.
	</p>
	<p>
		Contrary to popular belief,
		<a href="http://www.lipsum.com/" title="img/site.png" class="img">Lorem Ipsum</a>
		 is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.
	</p>
</div>
              
            
!

CSS

              
                * {padding:0px; margin:0px;}
	body {
		margin: 35px auto;
		padding: 0;
		width: 380px;
		font-size:13px;
		font-family:Arial, Helvetica, sans-serif;
	}
	p	{
		line-height:1.5; margin-bottom:6px;
	}
	#tip {
		position:absolute;
	  color:#FFFFFF;
		padding:5px;
		display:none;
		background:#450e4c;
	  border-radius: 5px;
	}
              
            
!

JS

              
                $(function(){
  var title_;
	var class_;
	var imgTag;

	$("a").hover(function(e) { 							// <a> hover 시 : mouseEnter

		title_ = $(this).attr("title");				// title을 변수에 저장
		class_ = $(this).attr("class");				// class를 변수에 저장
		$(this).attr("title","");							// title 속성 삭제 ( 기본 툴팁 기능 방지 )

		if(class_ == "img"){									// class_ 가 img라면,
			imgTag = "<img src='"+title_+"' width='100px' height:'100px' />"	// title_을 주소로 가진 <img>를 변수 imgTag에 저장
		}

		$("body").append("<div id='tip'></div>");		// div#tip 생성
																								// class_ 값에 따라 이미지 or 텍스트 출력 구분
			if (class_ == "img") {
				$("#tip").html(imgTag);
				$("#tip").css("width","100px");
			} else {
				$("#tip").css("width","300px");
				$("#tip").text(title_);
			}

			var pageX = $(this).offset().left -20;
			var pageY = $(this).offset().top - $("#tip").innerHeight();
			$("#tip").css({left : pageX + "px", top : pageY + "px"}).fadeIn(500);

	}, function() {													// <a> hover 시 : mouseLeave

		$(this).attr("title", title_);				// title 속성 반환
		$("#tip").remove();										// div#tip 삭제

	});
});
              
            
!
999px

Console