如何更改IOS的文本链接颜色

时间:2015-11-05 07:24:12

标签: html css

我发现文本链接颜色有问题,实际上我将链接颜色设置为桌面视图的红色。现在当我在Iphone中看到然后颜色变成蓝色。我在颜色代码后使用module Kernel def my_gets gets.chomp end end input = my_gets print(input) ,但这次结果相同,请告诉我是什么问题并给我最好的解决方案。

4 个答案:

答案 0 :(得分:0)

@media (min-device-width:320px) and (max-device-width:768px) 
{
  a {color:#ff0000;}
}

如果以上代码不适合您,则以下详细说明的代码可能会解决您在下面给出的问题。

/* ----------- iPhone 4 and 4S ----------- */

/* Portrait and Landscape */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 480px)
  and (-webkit-min-device-pixel-ratio: 2) {

}

/* Portrait */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 480px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: portrait) {
}

/* Landscape */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 480px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: landscape) {

}

/* ----------- iPhone 5 and 5S ----------- */

/* Portrait and Landscape */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2) {

}

/* Portrait */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: portrait) {
}

/* Landscape */
@media only screen 
  and (min-device-width: 320px) 
  and (max-device-width: 568px)
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: landscape) {

}

/* ----------- iPhone 6 ----------- */

/* Portrait and Landscape */
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 667px) 
  and (-webkit-min-device-pixel-ratio: 2) { 

}

/* Portrait */
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 667px) 
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: portrait) { 
      a {
        color: #ff0000;
      }

}

/* Landscape */
@media only screen 
  and (min-device-width: 375px) 
  and (max-device-width: 667px) 
  and (-webkit-min-device-pixel-ratio: 2)
  and (orientation: landscape) { 
      a {
        color: #ff0000;
      }

}

/* ----------- iPhone 6+ ----------- */

/* Portrait and Landscape */
@media only screen 
  and (min-device-width: 414px) 
  and (max-device-width: 736px) 
  and (-webkit-min-device-pixel-ratio: 3) { 
    a {
        color: #ff0000;
      }

}

/* Portrait */
@media only screen 
  and (min-device-width: 414px) 
  and (max-device-width: 736px) 
  and (-webkit-min-device-pixel-ratio: 3)
  and (orientation: portrait) { 
      a {
        color: #ff0000;
      }

}

/* Landscape */
@media only screen 
  and (min-device-width: 414px) 
  and (max-device-width: 736px) 
  and (-webkit-min-device-pixel-ratio: 3)
  and (orientation: landscape) { 
      a {
        color: #ff0000;
      }
}

答案 1 :(得分:0)

你应该有像

这样的东西
@media only screen 
and (min-device-width : 375px) 
and (max-device-width : 667px) {
   a {
      color: red;
   }
}

答案 2 :(得分:0)

可以添加" -webkit-appearance:none;"到锚标记,并设置字体颜色并从代码中删除重要

例如:

.link {
   color: blue;
   -webkit-appearance: none;
}

答案 3 :(得分:0)

好的,当我使用这种类型的元标记时,我发现了我的解决方案,我的文本链接颜色与我在css中描述的相同。

我在标题中使用此元标记。

<meta name="format-detection" content="telephone=no">