質問

I use this website, Responsinator it gives me different screen resolution that my mobile site will run on and it displays in the following output screen resolution/size:

  • iPhone 3+4 portrait · width: 320px
  • iPhone 3+4 landscape · width: 480px
  • iPhone 5 portrait · width: 320px
  • iPhone 5 landscape · width: 568px
  • Android portrait · width: 240px
  • Android landscape · width: 320px
  • Android (Nexus 4) portrait · width: 384px
  • Android (Nexus 4) landscape · width: 600px
  • iPad portrait · width: 768px
  • iPad landscape · width: 1024px
  • Kindle portrait · width: 600px
  • Kindle landscape · width: 1024px

The only time I want to load the shorter.css is when any of the following applies:

  • iPhone 3+4 portrait · width: 320px
  • iPhone 5 portrait · width: 320px
  • Android portrait · width: 240px
  • Android landscape · width: 320px

This is the CSS for the wider.css:

<!--
button:before {
    content: " ";
    display: inline-block;
    background: url("../theImages/ste.png") no-repeat;
    height: 38px;
    line-height: 38px;
    vertical-align: middle;
    width: 52px;
    margin-right: 20%;
}
button {
    border: 1px solid rgba(0,0,0,0.3);
    background: #eee;
    color: #515151;
    font-size: 24px;
    font-weight: 700;
    padding: 21px 34px;
    text-decoration: none;
    background: -webkit-gradient(linear, left bottom, left top, color-stop(0.21, rgb(203,203,203)), color-stop(0.58, rgb(227,226,226)));
    background: -moz-linear-gradient(center bottom, rgb(203,203,203) 21%, rgb(227,226,226) 58%);
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -moz-box-shadow: 0 0 0 5px rgba(255,255,255,0.3) /* glass edge */, inset 0 1px 0 0 rgba(255,255,255,0.5) /* top highlight */, inset 0 -3px 0 0 rgba(0,0,0,0.5) /* bottom shadow */;
    -webkit-box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 1px 0 0 rgba(255,255,255,0.5), inset 0 -3px 0 0 rgba(0,0,0,0.5);
    box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 1px 0 0 rgba(255,255,255,0.5), inset 0 -3px 0 0 rgba(0,0,0,0.5);
    text-shadow: 0 1px rgba(255,255,255,0.6);
}
button::-moz-focus-inner, a.button::-moz-focus-inner {
    padding:0;
    border:0;
}
button:hover, a.button:hover {
    background: #cbcbcb;
    cursor: pointer;
}
button:active, a.button:active {
    background: #ccc;
    padding: 22px 34px 20px; /* Bump down text */
    -moz-box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 -1px 0 0 rgba(255,255,255,0.5), inset 0 2px 5px 0 rgba(0,0,0,0.2);
    -webkit-box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 -1px 0 0 rgba(255,255,255,0.5), inset 0 2px 5px 0 rgba(0,0,0,0.2);
    box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 -1px 0 0 rgba(255,255,255,0.5), inset 0 2px 5px 0 rgba(0,0,0,0.2);
    text-shadow: none;
}
.red {
    background: #e1001a;
    color: #fff;
    background: -webkit-gradient(linear, left bottom, left top, color-stop(0.21, rgb(192,0,22)), color-stop(0.58, rgb(226,0,26)));
    background: -moz-linear-gradient(center bottom, rgb(192,0,22) 21%, rgb(226,0,26) 58%);
    text-shadow: 0 1px rgba(0,0,0,0.25);
}
.red:hover {
    background: #cb0018;
    text-shadow: 0 1px rgba(0,0,0,0);
}
.red:active {
    background: #ae0014;
}
-->

shorter.css:

<!--
button:before {
    content: " ";
    display: inline-block;
    background: url("../theImages/ste.png") no-repeat;
    height: 38px;
    line-height: 38px;
    vertical-align: middle;
    width: 52px;
    margin: 0 auto;
}
button {
    border: 1px solid rgba(0,0,0,0.3);
    background: #eee;
    color: #515151;
    font-size: 24px;
    font-weight: 700;
    padding: 21px 34px;
    text-decoration: none;
    background: -webkit-gradient(linear, left bottom, left top, color-stop(0.21, rgb(203,203,203)), color-stop(0.58, rgb(227,226,226)));
    background: -moz-linear-gradient(center bottom, rgb(203,203,203) 21%, rgb(227,226,226) 58%);
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border-radius: 5px;
    -moz-box-shadow: 0 0 0 5px rgba(255,255,255,0.3) /* glass edge */, inset 0 1px 0 0 rgba(255,255,255,0.5) /* top highlight */, inset 0 -3px 0 0 rgba(0,0,0,0.5) /* bottom shadow */;
    -webkit-box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 1px 0 0 rgba(255,255,255,0.5), inset 0 -3px 0 0 rgba(0,0,0,0.5);
    box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 1px 0 0 rgba(255,255,255,0.5), inset 0 -3px 0 0 rgba(0,0,0,0.5);
    text-shadow: 0 1px rgba(255,255,255,0.6);
}
button::-moz-focus-inner, a.button::-moz-focus-inner {
    padding:0;
    border:0;
}
button:hover, a.button:hover {
    background: #cbcbcb;
    cursor: pointer;
}
button:active, a.button:active {
    background: #ccc;
    padding: 22px 34px 20px; /* Bump down text */
    -moz-box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 -1px 0 0 rgba(255,255,255,0.5), inset 0 2px 5px 0 rgba(0,0,0,0.2);
    -webkit-box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 -1px 0 0 rgba(255,255,255,0.5), inset 0 2px 5px 0 rgba(0,0,0,0.2);
    box-shadow: 0 0 0 5px rgba(255,255,255,0.3), inset 0 -1px 0 0 rgba(255,255,255,0.5), inset 0 2px 5px 0 rgba(0,0,0,0.2);
    text-shadow: none;
}
.red {
    background: #e1001a;
    color: #fff;
    background: -webkit-gradient(linear, left bottom, left top, color-stop(0.21, rgb(192,0,22)), color-stop(0.58, rgb(226,0,26)));
    background: -moz-linear-gradient(center bottom, rgb(192,0,22) 21%, rgb(226,0,26) 58%);
    text-shadow: 0 1px rgba(0,0,0,0.25);
}
.red:hover {
    background: #cb0018;
    text-shadow: 0 1px rgba(0,0,0,0);
}
.red:active {
    background: #ae0014;
}
-->

The wider.css is looking fine as there is a space between the text and image but for the shorter.css the text and the image is too squashed together. How can I modify so there is a little space between the test and the image. Here is a screenshot:

enter image description here

役に立ちましたか?

解決

You can try jQueryUI plugin. They will save you a lot of time -

https://jqueryui.com/button/#icons

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top