gpt4 book ai didi

jquery - 将 CSS 用于随页面增长和收缩的文本和图像

转载 作者:太空宇宙 更新时间:2023-11-04 04:51:01 26 4
gpt4 key购买 nike

理想情况下,文本和图像(底部的按钮除外)会随着页面大小的调整而增大/缩小并保持对齐,但随后会停止缩小到原始大小的某个百分比。说30%。我对使用 CSS 或 jQuery 或两者都持开放态度。

最好/最干净的方法是什么?

查看我的代码:http://jsfiddle.net/ZZCMV/

或者:

HTML:

<html><head></head><body id="page_welcome">
<div class="wrapper">
<div class="main">
<div class="logo"><img src="https://qa.tweetcaster.com/assets/img/home/logo.png"></div>
<div class="tagline">
<div>The best thing to happen to Twitter since Twitter</div>
</div>
<div class="footer">
<div class="download">
<div>Over 10 million users! Get TweetCaster FREE:</div>
</div>
<ul class="devices">
<li><a href="https://play.google.com/store/apps/details?id=com.handmark.tweetcaster&referrer=utm_source%3DTCwebsite%26utm_medium%3Dweb%26utm_campaign%3DTCwebsite" target="_blank"><img src="https://qa.tweetcaster.com/assets/img/home/play_store.png" alt="TweetCaster for Android"></a></li>
<li><a href="http://itunes.apple.com/us/app/tweetcaster-for-twitter/id420792544?mt=8" target="_blank"><img src="https://qa.tweetcaster.com/assets/img/home/app_store.png" alt="TweetCaster for iPhone and iPad"></a></li>
<li><a href="/login" id="web"><img src="https://qa.tweetcaster.com/assets/img/home/web.png" alt="TweetCaster web app"></a></li>
<li>
<button id="dropdown_button" class="menu_button"><img src="https://qa.tweetcaster.com/assets/img/home/more.png" alt="More" ></button>
</li>
</ul>
<div class="links">
<a href="http://tweetcaster.uservoice.com/forums/183240-tweetcaster-web" class="feedback" target="_blank">Feedback</a> &#169;
<a href="http://onelouder.com" target="_blank">Onelouder</a>
<a href="http://tweetcaster.com/privacy" target="_blank">Privacy</a>
<a href="http://onelouder.com/#terms" target="_blank">Terms</a>
<a href="http://onelouder.com/#about" target="_blank">About</a>
<a href="http://support.onelouder.com" target="_blank">Help</a>
</div>
</div>
</div>
<div class="bird"><img src="https://qa.tweetcaster.com/assets/img/home/bird.png" alt="TweetCaster"></div>
</div>
</body>
</html>

CSS:

    html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
vertical-align: baseline;
}
body {
background: #7bc5ef url(https://qa.tweetcaster.com/assets/img/layout/bg.jpg) center top repeat-x;
padding-top: 15%;
font-family: Helvetica, Arial, sans-serif;
}
.main {
float: left;
top: 0px;
margin-left: 0;
width: 550px;
}
.wrapper {
text-align: center;
height: 100%;
position: relative;
margin-left: auto;
margin-right: auto;
width: 800px;
}
.logo {
margin: 30px 0px 0px;
}
.tagline {
font-size: 40px;
color: #ffffff;
text-shadow: 0px 2px 2px rgba(0,0,0, 10);
font-weight: 700;
width: 510px;
margin-left: auto;
margin-right: auto;
}
.footer {
bottom: 0px;
width: 550px;
left: 0px;
margin-top: 30%;
padding-bottom: 20px;
}
.download {
padding-top: 0px;
text-align: center;
color: #000000;
font-size: 22px;
margin-bottom: 10px;
font-weight: 700;
}
.links {
text-align: center;
font-size: 14px;
}
.links a {
padding-right: 5px;
color: #282828;
text-decoration: none;
}
.links a:hover {
text-decoration: underline;
}
.feedback {
font-weight: 700;
padding-right: 10px;
}
.devices li {
display: inline-block;
display: inline; /*ie7 fix */
padding-right: 7px;
}
.devices {
margin-left: 15px;
display: block;
margin-bottom: 30px;
}
.other_devices {
display: block;
margin: 0 0 0 5px;
}
.other_devices li {
display: inline-block;
display: inline; /*ie7 fix */
padding-right: 6px;
}
.bird img {
float: right;
max-width: 100%;
height: auto;
width: auto\9; /* ie8 */
float: right;
bottom: 0;
position: fixed;
z-index: -10;
_position: absolute;
_top:expression(eval(document.documentElement.scrollTop+ (document.documentElement.clientHeight-this.offsetHeight)));
height: 80%;
margin-left: -4%;
min-height: 400px;
min-width: 181px;
}
.menu_button {
background: none;
border: none;
margin-left: -7px;
cursor: pointer;
}
.hidden_menu {
background-color: white;
color: #000;
height: 328px;
position: absolute;
display: none;
margin-top: 0px;
width: 480px;
border: 1px solid #999999;
left: 40px;
top: 89px;
box-shadow: 0 2px 9px rgba(0, 0, 0, .75);
}
.get_tc {
color: #222222;
font-size: 20px;
text-align: center;
margin-top: 36px;
margin-bottom: 14px;
}
.dd_arrow {
position: absolute;
margin-left: 420px;
margin-top: 3px;
}
.tc_pink {
padding-top: 6px;
margin-bottom: 20px;
}
.get_tc {
margin-bottom: 10px;
}
.windows_button {
border-radius: 7px;
}
.clear:before, .clear:after {
content: ".";
display: block !important;
height: 0;
overflow: hidden;
}
.clear:after {
clear: both;
}
.clear {
zoom: 1;
} /* IE < 8 */
p {
margin-bottom: 18px;
}
p:first-child {
margin-bottom: 18px;
}
h1 {
font-size: 20px;
line-height: 26px;
font-weight: normal;
}
table, p, h1, h2, h3, h4, caption {
color: #888;
}

最佳答案

利用 CSS3 媒体查询根据浏览器和/或设备大小调整页面大小。这是一篇帮助您入门的好文章:http://css-tricks.com/css-media-queries/

至于图像,如果您设置了一个具有页面宽度百分比的容器,您可以将以下内容添加到页面 css 中,使它们响应并调整到窗口大小。

img {
max-width: 100%;
height: auto;
}

这将在不使用媒体查询的情况下调整页面上的图像大小,但如果您正在寻找更适合每种浏览器/设备尺寸的自定义方式,您肯定会希望使用媒体查询。

希望这对您有所帮助!

关于jquery - 将 CSS 用于随页面增长和收缩的文本和图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13482180/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com