Global White Space Reset (CSS/html)



This may not be useful to many people, but I thought it was interesting. If you do web design and use css you’ll probably like this… I found this post at leftjustified.net about a neat way to “reset” the padding and margin css information which can help for designing sites to display the same when using CSS. Unfortunately, many browsers have little quirks in displaying css, maybe they have strange default settings which cause css placement to look, well, strange, from one browser to another… in comes this little trick…


1. * {
2. padding:0;
3. margin:0;
4. }

Simple, elegant and effective reset of padding and margin information. They take it a bit further though…

Here’s another example

1. * {
2. padding:0;
3. margin:0;
4. }
5. body {padding:5px;}
6. h1, h2, h3, h4, h5, h6, p, pre, blockquote, form, label, ul, ol, dl, fieldset, address { margin:20px 0; }
7. li, dd, blockquote { margin-left: 40px; }
8. fieldset { padding:10px; }

Nice, but it has fixed px placement – what if someone resizes the browser or changes fontsize???

1. * {
2. padding:0;
3. margin:0;
4. }
5. h1, h2, h3, h4, h5, h6, p, pre, blockquote, label, ul, ol, dl, fieldset, address { margin:1em 5%; }
6. li, dd { margin-left:5%; }
7. fieldset { padding: .5em; }

Very nice… very fluid and very consistent rendering. The link above has example pages to browse as well. This is one of the nicest css tips I think I’ve seen.

Related Posts

Blog Traffic Exchange Related Posts
  • Using ssh to protect web browsing over wireless or other hostile networks This really could be used to encyrpt web traffic over any "hostile" network. Here's what I'm talking about. Laptop using wireless. Within our internal network we would LIKE all our web traffic to be encrypted at least from the laptop to a wired host. (From there to the outside world......
  • How much is it worth to you to have a responsive website? How can I say this.... this is one of the worst ideas I think I've heard this week from an ISP. (Maybe in a long time, but I'd have to think on that a few minutes.) An executive at Bellsouth thinks that ISP's ought to be able to charge certain......
  • Exploits a plenty - IE / Excel (Firefox?) There are a number of vulnerabilities that are currently unpatched, but have working publicly known exploits for Excel (*2) and Internet Explorer (2 vulnerabilities here as well.) Proof of Concept code has been released for both the Excel and Internet Explorer vulnerabilities. This means, with the code publicly available, it......
Blog Traffic Exchange Related Websites
  • Do It Yourself On-Page Search Engine Optimisation 2011 If you run a small business, have a website and don’t have endless amounts of cash, Search engine optimisation matters to you. For those of you who are unsure what it means, Wikipedia describes search engine optimisation (optimization) as follows: “Search engine optimization (SEO) is the process of improving the......
  • Take Advantage of Free Online Resources to Fasten Your Financial Future The web is awash with financial information resources. Don't continue down the road of debt-dependent lifestyle to an unplanned future in these uncertain economic times. More importantly, don't seek costly services, refinances, and reorganization of debt that promise to “help” you get out financial trouble without checking out free offerings......
  • 10 Benefits of Hosting your Own Blog If you want to create an edge over many of the other bloggers on the web, then one of the best things that you can do is host your own blog. There are a number of benefits of hosting your own blog over having some other service host your blog.......
www.pdf24.org    Send article as PDF   

Similar Posts


See what happened this day in history from either BBC Wikipedia
Search:
Keywords:
Amazon Logo

Comments are closed.


Switch to our mobile site