2014-04-29 5 views
1

Je vais avoir une vue web, je veux changer la couleur du lien bleu en blanc. ci-dessous la balise html je change de police son bon fonctionnement. s'il vous plaît dites-moi quelle est la balise html pour changer la couleur du lien.changer le lien couleur bleu en blanc

NSString* htmlContentString = [NSString stringWithFormat: 
              @"<html>" 
              "<style type=\"text/css\">" 
              "body { background-color:transparent; color: #eadfa8;font-family:Arial; font-size:24; }" 
              "</style>" 
              "<body>" 
              "<p>%@</p>" 
              "</body></html>", content1]; 

      [webview loadHTMLString:htmlContentString baseURL:nil]; 
+0

Essayez ma solution – nicael

Répondre

0

En CSS ajouter a{color:white}

NSString* htmlContentString = [NSString stringWithFormat: 
              @"<html>" 
              "<style type=\"text/css\">" 
              "body { background-color:transparent; color: #eadfa8;font-family:Arial; font-size:24; }" 
"a {color: white;}" 

              "</style>" 
              "<body>" 
              "<p>%@</p>" 
              "</body></html>", content1]; 

      [webview loadHTMLString:htmlContentString baseURL:nil]; 
+0

ne fonctionne pas. est la même que la couleur bleue – gowtham

+0

désolé mis à jour quelque chose était faux –

0

Si vous voulez changer tous les liens couleur blanc, vous pouvez ajouter dans votre css :

a:link{text-color:#ffffff} 
0

Utilisez le code suivant:

NSString* htmlContentString = [NSString stringWithFormat: 
              @"<html>" 
              "<style type=\"text/css\">" 
              "body { background-color:transparent; color: #eadfa8;font-family:Arial; font-size:24; }" 
              "body.a:link {color:#FFFFFF !important;}" 
              "</style>" 
              "<body>" 
              "<p>%@</p>" 
              "</body></html>", content1]; 

Vous pouvez définir la couleur de lien comme ci-dessous:

"body.a:link {color:#FFFFFF !important;}" 
+0

encore il est en bleu .. pourquoi? – gowtham

Questions connexes