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

  • ethr95awd

    ethr95awd

    8 Kasım 2006
  • Paste Magazine

    Paste Magazi

    28 AĞUSTOS 2008
  • SelmerSaxMan

    SelmerSaxMan

    24 HAZİRAN 2006