Copyright © All rights reserved | This template is made with by Colorlib

Next Big Event:

บทความในหมวด

JAVA SCRIPT

Java Script

เปลี่ยนขนาดตัวอักษรของ SyntaxHighlighter

2010-07-04 Games 3,621

บางคนอาจไม่ชอบขนาดตัวอักษรที่ทาง SyntaxHighlighter กำหนดมาให้ ซึ่งตรงนี้เราสามารถเข้าไปแก้ไขได้ที่ไฟล์ css ของ SyntaxHighlighter ดังนี้

 

เปิดไฟล์ shCore.css ที่อยู่ในโฟลเดอร์ styles ของ SyntaxHighlighter

 

.syntaxhighlighter,
.syntaxhighlighter div,
.syntaxhighlighter code,
.syntaxhighlighter table,
.syntaxhighlighter table td,
.syntaxhighlighter table tr,
.syntaxhighlighter table tbody
{
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	outline: 0 !important;
	background: none !important;
	text-align: left !important;
	float: none !important;
	vertical-align: baseline !important;
	position: static !important;
	left: auto !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	height: auto !important;
	width: auto !important;
	line-height: 1.1em !important;
	font-family: "Consolas", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace !important;
	font-weight: normal !important;
	font-style: normal !important;
	font-size: 1em !important;
	min-height: inherit !important; /* For IE8, FF & WebKit */
	min-height: auto !important; /* For IE7 */
}

 

 

แก้ font-size ตรงบรรทัดที่ 28 นั่นเอง โดยที่จะใช้หน่วย em หรือ px ก็ได้

 

ซึ่งหน่วย em จะเป็นหน่วยวัดค่าแบบ Relative ที่ใช้กำหนดขนาด font-size แบบสัมพันธ์กัน โดยที่ 1em จะหมายถึงขนาดปกติ , 0.5em หมายถึงลดขนาดลงครึ่งหนึ่งจากปกติ หรือ 2em หมายถึง สองเท่าของขนาดปกติ

 

*** หากเราใช้ font-size ในหน่วย px แล้ว จะทำให้ IE ไม่สามารถเปลี่ยนขนาด Font จากการเลือก Text Size ของ IE ได้ ***

 

 

อ้างอิง

 

www.k0n9.com - หน่วยวัดใน css

www.divland.com - px or em


| Java Script

เข้าชมแล้ว 2,935,274 ครั้ง | ทั้งเว็บออนไลน์   6 ท่าน | หน้านี้ออนไลน์   1 ท่าน
Page generated in 0.009 seconds ! ( 13 query)