Useful CSS "hacks" - Post any you have!

This is a discussion on "Useful CSS "hacks" - Post any you have!" within the Web Page Design section. This forum, and the thread "Useful CSS "hacks" - Post any you have! are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Oct 16th, 2005, 06:26
Junior Member
Join Date: Sep 2005
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Useful CSS "hacks" - Post any you have!

The idea of this topic is to just post however many hacks you have found useful. Links or sample code (with explanations) are helpful.

Here are a couple to get you started:Though the following isn't really a CSS hack, it is often used for CSS more than anything (at least in my experience).
Internet Explorer Conditional Comments (IE5+/Win only):
Code: Select all
<!-- [if gte IE 5]>
This text should be hidden.
<![endif] -->
Note the space between the opening "<!--" and the "[if". Microsoft's official page regarding the use of conditional comments does not show this space. If you do not include the space in the above code, the contents will be displayed on the page. With this in mind, I highly recommend reading the page.
Reply With Quote

  #2 (permalink)  
Old Oct 16th, 2005, 08:09
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Personally, I hate hacks.

There are in most cases a way to get around the need for hacks.

As a resource for web developers and designers, I feel I would be doing everyone an injustice if I didn't point out my loathing for them.

My 2 cents.
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #3 (permalink)  
Old Oct 16th, 2005, 12:43
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Not really a hack, just a good starting point...
First line of your style sheet;

* ( margin:0;padding:0 }

Pros - Simplicity (ie. not a complictated hack), Forces most-all browsers to render your styles in exactly the same way.

Cons - You need to re-define your paddings and margins for all your elements. May not be supported in some older browsers.

more on this subject here: http://www.meyerweb.com/eric/thought...doing-htmlcss/
Reply With Quote
  #4 (permalink)  
Old Oct 16th, 2005, 12:44
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,952
Blog Entries: 7
Thanks: 7
Thanked 4 Times in 4 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
Hey D3m0n....

You really should write us a CSS article you know.... you are full of these tips
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work
Reply With Quote
  #5 (permalink)  
Old Oct 16th, 2005, 12:56
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
But where to find the time these days?
Reply With Quote
  #6 (permalink)  
Old Oct 17th, 2005, 19:30
herkalees's Avatar
Highly Reputable Member
Join Date: Jul 2005
Location: Massachusetts, USA
Age: 87
Posts: 576
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to herkalees Send a message via MSN to herkalees Send a message via Yahoo to herkalees
I've been designing sites for a while now, using tons of CSS, no tables, bla bla, and I've never used a CSS hack.

They've never been necessary for the 100+ sites I've made.
Reply With Quote
  #7 (permalink)  
Old Oct 29th, 2005, 14:51
Junior Member
Join Date: Aug 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
I've never (knowingly) had a problem with the margin element. What problem does it cause between browsers? I find the border and padding elements to be the big pariahs since IE incorrectly includes them in the width/height calculations.

oh, wait, maybe to do with the collapsing (!not) of vertical margins in IE? I think I had that problem once.
Reply With Quote
Reply

Tags
useful, css, quothacksquot, post

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Noobish question regarding IE css "hacks" danielreid Web Page Design 4 Mar 25th, 2008 11:33
Creating a "tag" system to find relevant "related" pages MrQuestions PHP Forum 3 Mar 20th, 2008 23:06
[SOLVED] Show "Image" Depends On User "Status"? Monie Classic ASP 6 Oct 16th, 2007 01:22
? IS "meta name="robots" content="?" necessary in pages ? Love2Java Starting Out 6 Aug 8th, 2007 13:48
window.opener.document["nameForm"].getElementById("someid").value; doesnt work drpompeii JavaScript Forum 0 Feb 17th, 2007 23:09


All times are GMT. The time now is 00:23.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43