|
|||||||
New to SitePoint Forums? Register here for free!
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
SitePoint Articles
Join Date: Apr 2001
Posts: 0
|
Article Discussion
This is an article discussion thread for discussing the SitePoint article, "Introduction to Browser-Specific CSS Hacks"
|
|
|
|
|
|
#2 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Mar 2003
Location: UK
Posts: 246
|
That's a great resource, Not even any of the CSS books I have describe the different browser 'hacks' as welll as that article.
|
|
|
|
|
|
#3 |
|
SitePoint Addict
![]() ![]() ![]() Join Date: Jul 2004
Location: Schenectady, NY
Posts: 270
|
Good stuff.. I found the info on how to install many IE versions at once very useful
|
|
|
|
|
|
#4 |
|
SitePoint Zealot
![]() ![]() Join Date: Dec 2004
Location: Finland
Posts: 103
|
There's nice CSS hack chart at centricle.com if you need hack for specific browser versions.
|
|
|
|
|
|
#5 | ||
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,614
|
I think that /#eb3/ crept in there by itself
(it doesn't look valid to me)I don't usually comments on articles because its always hard to please everybody and its always difficult to get everything right but I do have a couple of comments that should be taken in consideration. Quote:
)Quote:
This code would fail in ie6 quirks mode ( where no doctype or partial doctype is used).: Code:
#header {padding: 2em; border: 0.5em; width: 15em; voice-family: "\"}\""; voice-family:inherit; width: 10em}
Paul |
||
|
|
|
|
|
#6 | |
|
SitePoint Wizard
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Mar 2003
Location: England, UK
Posts: 2,964
|
Quote:
Code:
* { margin:0;padding:0; }
|
|
|
|
|
|
|
#7 | |
|
SitePoint Zealot
![]() ![]() Join Date: May 2003
Location: London
Posts: 120
|
Quote:
Indeed, i've been toying with this idea for awhile, but I can't help thinking there's got to be a few downsides. Anybody know of any? |
|
|
|
|
|
|
#8 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,614
|
Off Topic: Quote:
|
|
|
|
|
|
|
#9 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2004
Location: London
Posts: 854
|
Konqueror - a *NIX browser which is way more popular (and alive) then Netscape 4.7 - seems to fail the @import hack
see this post I think its about time people stop spreading the @import myth - until the bug gets fixed by the KDE team. I estimate at least 1/3 of Linux users to be Konqueror users (that includes myself). The overall percentage is neglible still (~0.5%) but should carry on rising as Linux / Knoppix / KDE Desktops becomes more and more popular. ok I found out what is wrong: Konqueror only accepts: <style type="text/css">@import url(basic.css);</style> but will not accept @import url(basic.css) written on already externalized stylesheets. bah! lol |
|
|
|
|
|
#10 |
|
SitePoint Guru
![]() ![]() ![]() ![]() ![]() Join Date: Dec 2004
Location: London
Posts: 854
|
nor does it wrap in KHTML !
|
|
|
|
|
|
#11 |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,614
|
Hi,
In ie you can't reduce the margins of the hr for some reason. You should be able to place it where you want though. Here are various examples for you to play with. Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> hr.newrule { color: blue; height: 10px; border: 1px solid green; background-color: blue; } hr.newrule2 { height:1px; border:none; background:red; color:red; } hr.newrule3 { height:10px; border:none; background:red; color:pink; width:300px; position:absolute; left:100px; top:300px; } .border { border-top:1px solid red; height:0px; overflow:hidden; } </style> </head> <body> <p>Horizontal Rule test 1 - 1px green border and 10px blue centre</p> <hr class="newrule" /> <p>Horizontal Rule test 2 - 1px red centre line (no border)</p> <hr class="newrule2" /> <hr class="newrule2" /> <hr class="newrule2" /> <hr class="newrule2" /> <hr class="newrule3" /> <hr class="newrule3" /> <p>Horizontal Rule test 3 - use div as top border</p> <div class="border"></div> <p>Note for hr mozilla uses background colour and ie uses foreground colour so both need to be specified.</p> </body> </html> paul |
|
|
|
|
|
#12 |
|
Winemaster
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2004
Location: Sendai, Japan
Posts: 2,417
|
hgilbert,
Paul put me on to this Opera hack. He said it wasn't foolproof, but it worked where I wanted to use it. Code:
@media all and (min-width: 0px){
SELECTOR/id/etc
{STUFF GOES HERE
}}
|
|
|
|
|
|
#13 |
|
SitePoint Enthusiast
![]() Join Date: Sep 2004
Location: USA
Posts: 52
|
I like the '*' hack. It seems the easiest solution, if you can remember to deal with lists seperately. I'm gonna give it a go the next time I have to use a CSS hack.
Btw... OFF TOPIC: How do I use a custom avatar? I tried poking around the avatar section of my profile, but I couldn't fine the 'Custom' option. Wassup with that? |
|
|
|
|
|
#14 | |
|
Winemaster
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Oct 2004
Location: Sendai, Japan
Posts: 2,417
|
Off Topic: Quote:
|
|
|
|
|
|
|
#15 |
|
Always an apprentice
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2001
Location: Hattiesburg, MS
Posts: 1,150
|
I use the *{margin:0; padding:0;} inclusion, but I don't understand what your saying about lists. What would have to do in a list div to reset it to use bullets?
|
|
|
|
|
|
#16 | |
|
SitePoint Enthusiast
![]() Join Date: Sep 2004
Location: USA
Posts: 52
|
Quote:
> A lot of people do use this technique and it saves a lot of headaches. You just need to remember that lists will not show their bullets when padding/margin is reduced and this throws a few people but is simple enough to fix. I think he's saying that you'd have to override the * {margin:0} in lists to allow them to show thier bullets. ![]() |
|
|
|
|
|
|
#17 |
|
Always an apprentice
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Aug 2001
Location: Hattiesburg, MS
Posts: 1,150
|
yeah, but to what?
|
|
|
|
|
|
#18 | |
|
SitePoint Enthusiast
![]() Join Date: Sep 2004
Location: USA
Posts: 52
|
Quote:
|
|
|
|
|
|
|
#19 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,614
|
Hi,
Quote:
Heres a little test so you can see for yourself ![]() Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>list test</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> * {margin:0;padding:0} .five{padding-left:5px} .ten{padding-left:10px} .fifteen{padding-left:15px} .twenty{padding-left:20px} .fivem{margin-left:5px} .tenm{margin-left:10px} .fifteenm{margin-left:15px} .twentym{margin-left:20px} </style> </head> <body> <ul class="five"> <li>test 1 - 5px left padding</li> </ul> <ul class="ten"> <li>test 2 - 10px left padding</li> </ul> <ul class="fifteen"> <li>test 3 - 15px left padding</li> </ul> <ul class="twenty"> <li>test 4 - 20px left padding</li> </ul> <ul class="fivem"> <li>test 5 - 5px left margin</li> </ul> <ul class="tenm"> <li>test 6 - 10px left margin</li> </ul> <ul class="fifteenm"> <li>test 7 - 15px left margin</li> </ul> <ul class="twentym"> <li>test 8 - 20px left margin</li> </ul> </body> </html> Last edited by Paul O'B; Feb 9, 2005 at 05:12. |
|
|
|
|
|
|
#20 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,614
|
Quote:
|
|
|
|
|
|
|
#21 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,614
|
Quote:
|
|
|
|
|
|
|
#22 | |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,614
|
Quote:
Code:
* html body{background:red;}
e.g. Code:
*+html .test{bac\kground:blue}
http://www.dynamicsitesolutions.com/...ild-plus-html/ |
|
|
|
|
|
|
#23 |
|
CSS Advisor
![]() Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,614
|
Hi Natalie if you are trying to omit styles from IE7 using the child selector (>) then it wont work because ie7 understands the child selector.
Use conditional comments to target different verision of IE more easily. |
|
|
|
![]() |
| Bookmarks |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
|
All times are GMT -7. The time now is 02:44.






(it doesn't look valid to me)



Hybrid Mode
