แทนที่รูปภาพกับ CSS

CSS No Comments

สำหรับเทคนิคที่ใช้บ่อยคือ

HTML คือ
<h1 id=”ex111″><span>CSS-Tricks</span></h1>

CSS คือ
h1#ex111 {width: 250px; height: 25px; background-image: url(logo.gif); }
h1#ex111 span {display: none;}

HTML คือ
<h1 class=”ex222″> CSS-Tricks</h1>

CSS คือ
h1.ex222 {width: 350px; height: 75px; background: url(“images/header-image.jpg”); text-indent: -9999px; }

Leave a Reply

Powered by WordPress | Theme by Be4phuket