首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >移动视图中的链接缩小

问移动视图中的链接缩小
EN

Stack Overflow用户
提问于 2017-07-02 21:13:39
回答 1查看 29关注 0票数 0

所以我正在做一个网上作品集,我的一些诗,有电子书启发的布局。在移动视图中,我有一个奇怪的问题,我似乎无法完全解决。在“认可”页面上,链接文本比普通文本小。我使用ID标签与这些链接,以便它们的格式不同(标题是斜体,出版物是粗体)。将此位添加到标头使所有文本大小相同:

代码语言:javascript
复制
<style>

body {
    -webkit-text-size-adjust: 100%
}

</style>

问题是,整个页面显示的尺寸比我想要的要小,我认为在屏幕上更难阅读。

我意识到的另一件事是,所有链接都可能有问题,但这些链接是唯一值得注意的链接,因为它们嵌入了常规文本(而其他链接则不是)。我已经尝试了我所能想到的一切,但无法修复它,但这也是我第一次使用@media标记,所以我确信我遗漏了一些东西。

知道是什么导致了这一切吗?下面是页面的动态链接,这样您就可以看到我在说什么,下面还包含了一些代码。

下面是CSS:

代码语言:javascript
复制
    /* color reference

  lilac - #D8BFD8
  dark gray - #74756a

*/




/* cover */

#moon {

  width: 300px;
  height: 300px;
  border-radius: 50%;
  box-shadow: 30px 15px 3px 0 #D8BFD8;
}



#title {
      font-family: "Geo";
    font-size: 92px;
    color: #74756a;
    letter-spacing: 40px;
    text-transform: uppercase;
    text-shadow: -2px 0 1px rgba(255,0,255,0.5) , 0px 0 1px rgba(155,155,155,0.5) ;
    display: inline-block;

}

#by {
    font-family: "Geo";
    font-size: 24px;
    color: #74756a;
    /* font-weight: lighter; */
    letter-spacing: 20px;
    text-transform: none;

        /*taller*/
    display: inline-block;
    transform: scaleY(1.1);  
}

.button {
  font-family: "Geo";
  border-radius: 4px;
  background-color: transparent;
  border: none;
  color: #D8BFD8;
  text-align: center;
  font-size: 28px;
  padding: 20px;
  width: 200px;
  transition: all 0.5s;
  cursor: pointer;
  margin: 5px;
}

.button a {
  font-family: "Geo";
  border-radius: 4px;
  background-color: transparent;
  border: none;
  color: #D8BFD8;
  text-align: center;
  font-size: 28px;
}


.button span {
  cursor: pointer;
  display: inline-block;
  position: relative;
  transition: 0.5s;
}

.button span:after {
  content: '\00bb';
  position: absolute;
  opacity: 0;
  top: 0;
  right: -20px;
  transition: 0.5s;
}

.button:hover span {
  padding-right: 25px;
}

.button:hover span:after {
  opacity: 1;
  right: 0;
}


.splash {background: linear-gradient(266deg, #4e0846, #9f8c98, #d8d8bf, #ffffff);
background-size: 800% 800%;

-webkit-animation: AnimationName 30s ease infinite;
-moz-animation: AnimationName 30s ease infinite;
animation: AnimationName 30s ease infinite;}

@-webkit-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 51%}
    100%{background-position:0% 50%}
}
@-moz-keyframes AnimationName {
    0%{background-position:0% 50%}
    50%{background-position:100% 51%}
    100%{background-position:0% 50%}
}
@keyframes AnimationName { 
    0%{background-position:0% 50%}
    50%{background-position:100% 51%}
    100%{background-position:0% 50%}
}

/* Body Fonts */

@font-face {
    font-family: Geo;
    src: url(geo.ttf);
}

body {
    font-size: 18px;
}

p {
  font-family: "Geo";

  text-align: left;
  margin-left: auto;
  margin-right: auto;
  width: 30em;

}





/* TOC, Coming Soon & Acknowledgements */

p#contents {
  font-family: "Geo";
  text-align: left;
  margin-left: 40%;
  width: 100em;

}



a#ack {
    text-decoration: none;
    font-family: "Geo";
    font-weight: lighter;
    font-style: italic;
    color: #74756a;

}

a#ack:hover {
   color: #D8BFD8;
}

}

#low {

  font-family: "Geo";
  text-align: left;
  margin-left: auto;
  margin-right: auto;
  margin-top: 10%;
  width: 30em;
}

a#soon {
    text-decoration: none;
    font-weight: bold;
    color: #74756a;
    padding: 0;
}

 a#soon:hover {
    color: #D8BFD8;
}





/* headers */

h1 {
    display: inline;
    font-family: "Geo";
    font-size: 42px;
    color: #74756a;
    /* font-weight: lighter; */
    letter-spacing: 10px;
    text-transform: uppercase;

    text-shadow: -2px 0 1px rgba(255,0,255,0.5) , 0px 0 1px rgba(155,155,155,0.5) ;

        /*taller*/
    display: inline-block;
    transform: scaleY(1.1);


}

h2 {
    display: inline;
    font-family: "Geo";

    color: #74756a;
    font-weight: lighter; 
    letter-spacing: 3px;

}


h3 {
    display: inline;
    font-family: "Geo";
    font-size: 34px;
    color: #74756a;
    font-weight: lighter; 
    letter-spacing: 3px;


}


h4{
  text-align: center;
  font-family: "Geo";

  color: #74756a;
}

/* Arrows */

#left {
    position: absolute;
    top: 50%;
    left: 5%;
    -moz-transform: translateX(-5%) translateY(-50%);
    -webkit-transform: translateX(-5%) translateY(-50%);
    transform: translateX(-5%) translateY(-50%);
}

#right {
    position: absolute;
    top: 50%;
    right: 5%;
    -moz-transform: translateX(-5%) translateY(-50%);
    -webkit-transform: translateX(-5%) translateY(-50%);
    transform: translateX(-5%) translateY(-50%);
}

a {
    text-decoration: none;
    font-family: "Geo";
    font-weight: bold;
    display: inline-block;
    color: #74756a;
}

a:hover {
    color: #D8BFD8;

}


}

.round {
    border-radius: 50%;
}


/* Social Media Icons */

.header {
  text-align: center;
}

#menu-outer {
  height: 25px;
  background: url(images/bar-bg.jpg) repeat-x;
}

.table {
  display: table;   /* Allow the centering to work */
  margin: 0 auto;
}

ul#social-media-list{
  min-width: 300px;
  list-style: none;
  padding-top: 5px;
  }

ul#social-media-list li {
  display: inline;
}

ul#social-media-list a:hover {
  border-bottom: 5px solid #D8BFD8;
  border-right: 5px solid #D8BFD8;
}




/*Formal Anomolies<*/

.jty {

      text-align: justify;
      text-indent: 0;
  font-family: "Geo";


}


.ery {

  font-family: "Geo";

  text-align: left;
  margin-left: 35%;

}


/*mobile*/

@media (min-width: 858px) {
    html {
        font-size: 12px;
    }


}

@media (min-width: 780px) {
    html {
        font-size: 11px;
    }


}

@media (min-width: 702px) {
    html {
        font-size: 10px;
    }


}

@media (min-width: 724px) {
    html {
        font-size: 9px;
    }


}

@media (max-width: 623px) {
    html {
        font-size: 8px;
    }



}

下面是HTML:

代码语言:javascript
复制
<html>
<head>
<title>Stephanie Lane Sutton | Acknowledgements</title>
<meta name="HandheldFriendly" content="true" />
<meta name="MobileOptimized" content="320" />
<meta name="viewport" content="initial-scale=0.50, maximum-scale=3, width=device-width, user-scalable=yes" />
<link rel="stylesheet" href="ebook.css" type="text/css">

<!DOCTYPE html 
      PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en-US">
<head profile="http://www.w3.org/2005/10/profile">
<link rel="icon" 
      type="image/png" 
      href="flwr.png">


<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="functions.js"></script>

<style>

    body {
        -webkit-text-size-adjust: 100%
    }

</style>

</head>
<body>
<div id="wrapper">
<center><h3>Acknowledgements</h3>
</center>
<p><br>
Thanks to the following publications which first published these poems: 

<br><br><br>
<a href="murmuration.html" id="ack">Murmuration</a> and <a href="spit.html" id="ack">Spit</a> were originally published in <a href="http://arseniclobster.magere.com/archive/issuefortyone/index.html" id="soon">Arsenic Lobster</a>. <br><br>

<a href="hyperv.html" id="ack">Hypervigilance (w/ Emily Dickinson)</a> was originally published in <a href="https://rads.stackoverflow.com/amzn/click/com/B00FDWVIHO" rel="nofollow noreferrer" id="soon">Day One</a>. <br><br>

<a href="death.html" id="ack">Death Visits as Often as a Distant Relative</a> was originally published in <a href="http://districtlit.com/post/112434612956/sutton" id="soon">District Lit</a>.<br><br>

<a href="er.html" id="ack">Emergency Department Aftercare Instructions</a> is forthcoming in <a href="http://www.dreampoppress.net/" id="soon">Dream Pop Press</a>. <br><br>

<a href="transitive.html" id="ack">A Transitive Verb</a> was originally published in <a href="http://www.cooprenner.com/2012/11/Trans.html" id="soon">elimae</a>.<br><br>

<a href="slammer.html" id="ack">Slammer</a> was originally published in <a href="https://thefemlitmagazine.wordpress.com/2015/11/26/slammer-stephanie-lane-sutton/" id="soon">The Fem</a>.</br><br>

<a href="loureed.html" id="ack">The Day Lou Reed Died</a> was originally published in <a href="http://www.freezeraypoetry.com/stephanie-lane-sutton.html" id="soon">FreezeRay Poetry</a><br><br>

<a href="revocation.html" id="ack">Revocation</a> was originally published in <a href="http://www.heartjournalonline.com/stephanie/" id="soon">HEArt Journal Online</a>.<br><br>

<a href="afterall.html" id="ack">After All</a> is forthcoming in <a href="http://www.littletell.org/" id="soon">littletell</a>.<br><br>

<a href="band.html" id="ack">In Middle School Band</a> was originally published in <a href="http://www.moonsickmagazine.com/two-poems-by-stephanie-lane-sutton.html" id="soon">Moonsick Magazine</a><br><br>

<a href="eurydice.html" id="ack">Eurydice In Hell</a> was originally published in <a href="http://www.thrushpoetryjournal.com/september-2014-stephanie-lane-sutton.html" id="soon">THRUSH Poetry Journal</a>. <br><br>

<a href="hysteria.html" id="ack">Hysteria</a> was originally published in <a href="http://www.tinderboxpoetry.com/hysteria" id="soon">Tinderbox Poetry Journal</a>.<br><br>





<center><a href=index.html>&#8962;</a></center>



</p>

<div id="left"><a href="er.html" class="previous round">&#8249;</a></div>

</div>
<br><br>
<br><br>



</div>

<div id="social-media-list">
  <div class="table">
    <ul id="social-media-list">

        <li>
            <a href=http://www.facebook.com/stephanielanesutton><img src=facebook.png></a> 
        </li>

        <li>
            <a href=http://twitter.com/StephanieLaneS><img src=twitter.png></a> 
        </li>

        <li>
            <a href=http://www.instagram.com/disorderliness/><img src=instagram.png></a> 
        </li>

        <li>
            <a href=http://github.com/wirginiavoolf><img src=github.png></a> 
        </li>

    </ul>





</div>




</body>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-07-02 21:30:20

您可以使用CSS中的@media查询来根据屏幕大小更改页面布局。

代码语言:javascript
复制
@media screen and (min-width: 480px) {
    a { 
        font-size: 12px
    }
}

基本上,您只需粘贴到您希望根据屏幕大小更改的所有CSS代码中,只需更改值;在本例中,将其粘贴到引用链接的CSS中,只需更改“字体大小:12 in”值。

这将允许您在终端用户浏览器屏幕为480 or或更少时调整文本大小。如果您想在平板设备上做同样的事情,请使用768 to。

编辑:

您所使用的字体大小值非常小,无论屏幕大小如何,8px都将非常小。对于移动屏幕上的标准文本,我倾向于坚持10-12 is,而只关注它是什么。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44875261

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档