|
7/9 |
2003/11/29-12/1 [Computer/SW/Languages/Misc] UID:11262 Activity:nil |
11/28 With HTML, I don't like how text runs from the left edge to the right edge of the browser window. Without using a table with a width that's some percentage of the screen, how can I let there be a (empty) margin on both sides of the text? It's easier to read this way. Thanks. \_ use <div> ... </div> tags to surround the text and use CSS to specify the location and width of that region. you also could use CSS to specify margins for the <body> tag, but that will apply to everything, not just text. \_ Wow, for a second I saw <booty> rather than <body>. I was trying to figure out what the hell the <booty> tag did, and when it got added to the spec.... \_ you're totally right. use css: body { padding-left: 10%; padding-right: 10%; } \_ hey that's awesome. now is there a way to fill up that empty 10% on the left side with a solid bar of color, or some sort of vertically-oriented image? \_ make another div, set the width to 10% and set the background-color: orange; \_ something like body { padding-left: 10%; padding-right: 10%; background: orange url(./img.jpg) no-repeat top left; } might work, experiment. See http://www.csszengarden.com \_ use css but make sure you test on whatever browsers you want to use. IE 5 fucks some stuff up, so I test against IE5 and Firebird (which is pretty similar to IE6 in terms of rendering CSS... but better) \_ Cool, thanks everyone. -op |
7/9 |
|
www.csszengarden.com -> www.csszengarden.com/ Download the sample html file and css file The Road to Enlightenment Littering a dark and dreary road lay the past relics of browser-specific tags, incompatible DOM s, and broken CSS support. Web enlightenment has been achieved thanks to the tireless efforts of folk like the W3C , WaSP and the major browser creators. The css Zen Garden invites you to relax and meditate on the important lessons of the masters. Learn to use the yet to be time-honored techniques in new and invigorating fashion. There is clearly a need for CSS to be taken seriously by graphic artists. The Zen Garden aims to excite, inspire, and encourage participation. Clicking on any one will load the style sheet into this very page. CSS 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. To date, most examples of neat tricks and hacks have been demonstrated by structurists and coders. You are modifying this page, so strong CSS skills are necessary, but the example files are commented well enough that even CSS novices can use them as starting points. Please see the CSS Resource Guide for advanced tutorials and tips on working with CSS . You may modify the style sheet in any way you wish, but not the HTML . This may seem daunting at first if youve never worked this way before, but follow the listed links to learn more, and use the sample files as a guide. Download the sample html file and css file to work on a copy locally. The css Zen Garden is about functional, practical CSS and not the latest bleeding-edge tricks viewable by 2 of the browsing public. Unfortunately, designing this way highlights the flaws in the various implementations of CSS . Different browsers display differently, even completely valid CSS at times, and this becomes maddening when a fix for one leads to breakage in another. View the Resources page for information on some of the fixes available. Full browser compliance is still sometimes a pipe dream, and we do not expect you to come up with pixel-perfect code across every platform. If your design doesnt work in at least IE5/Win and Mozilla run by over 90 of the population, chances are we wont accept it. |