900字范文,内容丰富有趣,生活中的好帮手!
900字范文 > CSS禅意花园初始页面布局分析

CSS禅意花园初始页面布局分析

时间:2022-12-29 04:35:18

相关推荐

CSS禅意花园初始页面布局分析

如题

打算把布局练得差不多了再仔细的学js,禅意花园的布局还比较简单就照着写了一遍来看看。

需要的话大家可以自己跑跑看,大致的布局我给加了边框线容易理解了。

还有顺便提个问:本来是无序列表的li设置成块元素后没有前面的圆点了,这是为啥?

<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>garden</title><style>/*基础元素们*/html{margin: 0;padding: 0;}body{font: 75% georgia, sans-serif ;line-height: 1.88889;color: #555753;/*樱花树背景图右下角对齐*/background: #fff url(/001/blossoms.jpg) no-repeat bottom right;margin: 0;padding: 0;}p{margin-top: 0;text-align: justify;/*justify实现两端对齐文本效果。*/}h3{font: italic normal 1.4em georgia, sans-serif;letter-spacing: 1px;margin-bottom: 0;color: #7D775C;}a:link{font-weight: bold;text-decoration: none;color: #B7A5DF;}a:visited {font-weight: bold;text-decoration: none;color: #D4CDDC;}a:hover, a:focus, a:active {text-decoration: underline;color: #9685BA;}abbr{border-bottom: none;}/*特殊元素*/.page-wrapper {/*荷塘完全本领背景图左上角对齐*/background: url(/001/zen-bg.jpg) no-repeat top left;padding: 0 175px 0 110px;margin: 0;position: relative;}.intro{min-width: 470px;width: 100%;}header h1 {/*transparent是全透明黑色(black)的速记法,即一个类似rgba(0,0,0,0)这样的值*//*此处把背景设置为透明可以显示被覆盖的元素*/background: transparent url(/001/h1.gif) no-repeat top left;margin-top: 10px;/*块级元素在浏览器显示时,通常会以新行来开始(和结束)。*/display: block;width: 219px;height: 87px;float: left;/*缩进定义百分比是基于父元素宽度*/text-indent: 100%;white-space: nowrap;overflow: hidden;/*缩进100%且不换行再hidden溢出,文本被完全隐藏只剩背景图*/}header h2{background: transparent url(/001/h2.gif) no-repeat top left;margin-top: 58px;margin-bottom: 40px;width: 200px;height: 18px;float: right;text-indent: 100%;white-space: nowrap;overflow: hidden;}header{padding-top: 20px;height: 87px;}.summary{clear: both;margin: 20px 20px 20px 10px;width: 160px;float: left;}.summary p{font: italic 1.1em/2.2 georgia;text-align: center;}.preamble{clear: right;padding: 0px 10px 0 10px;}.support{padding-left: 10px;margin-bottom: 40px;}footer{text-align: center;}footer a:link, footer a:visited {margin-right: 20px;}.side{margin-left: 600px;position: absolute;top: 0;right: 0;}.side .wrapper{font: 10px verdana, sans-serif;background: transparent url(/001/paper-bg.jpg) top left repeat-y;padding: 10px;margin-top: 150px;width: 130px;}.side h3.select{background: transparent url(/001/h3.gif) no-repeat top left;margin: 10px 0 5px 0;width: 97px;height: 16px;text-indent: 100%;white-space: nowrap;overflow: hidden;}.side h3.archives{background: transparent url(/001/h5.gif) no-repeat top left;margin: 25px 0 5px 0;width:57px;height: 14px;text-indent: 100%;white-space: nowrap;overflow: hidden;}.side h3.resource{background: transparent url(/001/h6.gif) no-repeat top left;margin: 25px 0 5px 0;width:63px;height: 10px;text-indent: 100%;white-space: nowrap;overflow: hidden;}.side ul{margin: 0;padding: 0;}.side li{line-height: 1.3em;/*侧边栏的分隔横线*/background: transparent url(/001/cr1.gif) no-repeat top center;/*不懂就问:这里本来是无序列表的li设置成块元素后没有前面的圆点了*/display: block;padding-top: 5px;margin-bottom: 5px;list-style-type: none;}.side li a:link{color: #988F5E;}.side li a:visited {color: #B3AE94;}.extra1{background: transparent url(/001/cr2.gif) top left no-repeat;position: absolute;top: 40px;right: 0;width: 148px;height: 110px;}/*布局边框线*/div{border: 2px dashed #ed462c;margin: 5px}header, h1, h2, h3, .summary, footer{border: 1px solid #A29EA3;}</style></head><body><!--页面包--><div class="page-wrapper"><!--前面的标题及概述部分--><section class="intro" id="intro"><!--标题--><header><h1>CSS Zen Garden</h1><h2>The Beauty of <abbr title="Cascading Style Sheets">CSS</abbr> Design</h2></header><!--概括--><div class="summary" id="summary"><p>A demonstration of what can be accomplished through <abbr title="Cascading Style Sheets">CSS</abbr>-based design. Select any style sheet from the list to load it into this page.</p><p>Download the example <a href="/examples/index" title="This page's source HTML code, not to be modified.">html file</a> and <a href="/examples/style.css" title="This page's sample CSS, the file you may modify.">css file</a></p></div><!--序言--><div class="preamble"><h3>The Road to Enlightenment</h3><p>Littering a dark and dreary road lay the past relics of browser-specific tags, incompatible <abbr title="Document Object Model">DOM</abbr>s, broken <abbr title="Cascading Style Sheets">CSS</abbr> support, and abandoned browsers.</p><p>We must clear the mind of the past. Web enlightenment has been achieved thanks to the tireless efforts of folk like the <abbr title="World Wide Web Consortium">W3C</abbr>, <abbr title="Web Standards Project">WaSP</abbr>, and the major browser creators.</p><p>The CSS Zen Garden invites you to relax and meditate on the important lessons of the masters. Begin to see with clarity. Learn to use the time-honored techniques in new and invigorating fashion. Become one with the web.</p></div></section><!--文章的主体部分,每个单独的章节用div分块--><div class="mian support"><div class="explan"><h3>So What is This About?</h3><p>There is a continuing need to show the power of <abbr title="Cascading Style Sheets">CSS</abbr>. The Zen Garden aims to excite, inspire, and encourage participation. To begin, view some of the existing designs in the list. Clicking on any one will load the style sheet into this very page. The <abbr title="HyperText Markup Language">HTML</abbr> remains the same, the only thing that has changed is the external <abbr title="Cascading Style Sheets">CSS</abbr> file. Yes, really.</p><p><abbr title="Cascading Style Sheets">CSS</abbr> allows complete and total control over the style of a hypertext document. The only way this can be illustrated in a way that gets people excited is by demonstrating what it can truly be, once the reins are placed in the hands of those able to create beauty from structure. Designers and coders alike have contributed to the beauty of the web; we can always push it further.</p></div><div class="participation"><h3>Participation</h3><p>Strong visual design has always been our focus. You are modifying this page, so strong <abbr title="Cascading Style Sheets">CSS</abbr> skills are necessary too, but the example files are commented well enough that even <abbr title="Cascading Style Sheets">CSS</abbr> novices can use them as starting points. Please see the <a href="/zengarden/resources/" title="A listing of CSS-related resources"><abbr title="Cascading Style Sheets">CSS</abbr> Resource Guide</a> for advanced tutorials and tips on working with <abbr title="Cascading Style Sheets">CSS</abbr>.</p><p>You may modify the style sheet in any way you wish, but not the <abbr title="HyperText Markup Language">HTML</abbr>. This may seem daunting at first if you&#8217;ve never worked this way before, but follow the listed links to learn more, and use the sample files as a guide.</p><p>Download the sample <a href="/examples/index" title="This page's source HTML code, not to be modified.">HTML</a> and <a href="/examples/style.css" title="This page's sample CSS, the file you may modify.">CSS</a> to work on a copy locally. Once you have completed your masterpiece (and please, don&#8217;t submit half-finished work) upload your <abbr title="Cascading Style Sheets">CSS</abbr> file to a web server under your control. <a href="/zengarden/submit/" title="Use the contact form to send us your CSS file">Send us a link</a> to an archive of that file and all associated assets, and if we choose to use it we will download it and place it on our server.</p></div><div class="benefits"><h3>Benefits</h3><p>Why participate? For recognition, inspiration, and a resource we can all refer to showing people how amazing <abbr title="Cascading Style Sheets">CSS</abbr> really can be. This site serves as equal parts inspiration for those working on the web today, learning tool for those who will be tomorrow, and gallery of future techniques we can all look forward to.</p></div><div class="requirements"><h3>Requirements</h3><p>Where possible, we would like to see mostly <abbr title="Cascading Style Sheets, levels 1 and 2">CSS 1 &amp; 2</abbr> usage. <abbr title="Cascading Style Sheets, levels 3 and 4">CSS 3 &amp; 4</abbr> should be limited to widely-supported elements only, or strong fallbacks should be provided. The CSS Zen Garden is about functional, practical <abbr title="Cascading Style Sheets">CSS</abbr> and not the latest bleeding-edge tricks viewable by 2% of the browsing public. The only real requirement we have is that your <abbr title="Cascading Style Sheets">CSS</abbr> validates.</p><p>Luckily, designing this way shows how well various browsers have implemented <abbr title="Cascading Style Sheets">CSS</abbr> by now. When sticking to the guidelines you should see fairly consistent results across most modern browsers. Due to the sheer number of user agents on the web these days &#8212; especially when you factor in mobile &#8212; pixel-perfect layouts may not be possible across every platform. That&#8217;s okay, but do test in as many as you can. Your design should work in at least IE9+ and the latest Chrome, Firefox, iOS and Android browsers (run by over 90% of the population).</p><p>We ask that you submit original artwork. Please respect copyright laws. Please keep objectionable material to a minimum, and try to incorporate unique and interesting visual themes to your work. We&#8217;re well past the point of needing another garden-related design.</p><p>This is a learning exercise as well as a demonstration. You retain full copyright on your graphics (with limited exceptions, see <a href="/zengarden/submit/guidelines/">submission guidelines</a>), but we ask you release your <abbr title="Cascading Style Sheets">CSS</abbr> under a Creative Commons license identical to the <a href="/licenses/by-nc-sa/3.0/" title="View the Zen Garden's license information.">one on this site</a> so that others may learn from your work.</p><p role="contentinfo">By <a href="/">Dave Shea</a>. Bandwidth graciously donated by <a href="/">mediatemple</a>. Now available: <a href="/exec/obidos/ASIN/0321303474/mezzoblue-20/">Zen Garden, the book</a>.</p></div><!--脚注链接被包括在主要部分内--><footer><a href="#">HTML</a><a href="#">CSS</a><a href="#">CC</a><a href="#">A11y</a><a href="#">GH</a></footer></div><!--整个侧边栏用一个aside包裹div统一背景及基础属性,再分成数个div分开描述--><aside class="side"><div class="wrapper"><!--设计者列表--><div class="design-selection"><h3 class="select">Select a Design:</h3><nav><ul><li><a href="#" class="name">Alfred</a> by <a href="#">Arthur</a></li><li><a href="#" class="name">Alfred</a> by <a href="#">Arthur</a></li><li><a href="#" class="name">Alfred</a> by <a href="#">Arthur</a></li><li><a href="#" class="name">Alfred</a> by <a href="#">Arthur</a></li><li><a href="#" class="name">Alfred</a> by <a href="#">Arthur</a></li><li><a href="#" class="name">Alfred</a> by <a href="#">Arthur</a></li><li><a href="#" class="name">Alfred</a> by <a href="#">Arthur</a></li><li><a href="#" class="name">Alfred</a> by <a href="#">Arthur</a></li></ul></nav></div><!--归档--><div class="design-archives"><h3 class="archives">Archives:</h3><nav><ul><li><a href="#">Next Designs <span class="indicator">&rsaquo;</span></a></li><li><a href="#">View All Designs </a></li></ul></nav></div><div class="resources"><h3 class="resource">Resources:</h3><ul><!--&#8217;转义字符单引号--><li><a href="#">View This Design&#8217;s </a></li><li><a href="#">Resources </a></li><li><a href="#">FAQ </a></li><li><a href="#">Submit a Design </a></li><li><a href="#">Translations </a></li></ul></div></div></aside></div><!--页面包的脚。--><!--自由发挥的部分--鸟居装饰图--><div class="extra1"></div></body></html>

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。