Gizle metin kullanarak css | Netgez.com
SORU
23 Ocak 2009, Cuma


Gizle metin kullanarak css

Bu benim gibi bir html etiketi var:

<h1>My Website Title Here</h1>

Kullanarak benim gerçek logo, metin ile değiştirmek istiyorum css. Logosu var etiketi boyutlandırma ve arka plan resmi css ile düşük derece ile bir sorunum yok. Ancak, metin kurtulmak için nasıl çözemiyorum. Bunu daha önce yaptı, temelde ekranın dışına metni iterek gördüm. Sorun nerede gördüğümü hatırlamıyorum.

CEVAP
23 Ocak 2009, Cuma


Bu bir yoldur:

h1 {
    text-indent: -9999px;                 /* sends the text off-screen */
    background-image: url(/the_img.png);  /* shows image */
    height: 100px;                        /* be sure to set height & width */
    width: 600px;
    white-space: nowrap;            /* because only the first line is indented */
}

h1 a {
    outline: none;  /* prevents dotted line when link is active */
}

Burada another way tarayıcı yaratacak büyük 9999 pixel kutusunu kaçınarak metin gizlemek için:

h1 {
    background-image: url(/the_img.png);  /* shows image */
    height: 100px;                        /* be sure to set height & width */
    width:  600px;

    /* Hide the text. */
    text-indent: 100%;
    white-space: nowrap;
    overflow: hidden;
}

Bunu PaylaÅŸ:
  • Google+
  • E-Posta
Etiketler:
Css

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • 24 Канал

    24 КанаÐ

    5 ÅžUBAT 2006
  • Vladimir Jenko

    Vladimir Jen

    1 Mart 2010
  • WoodysGamertag

    WoodysGamert

    17 Aralık 2009