Go Back   SitePoint Forums > Forum Index > Design Your Site > Web Page Design > CSS
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Sep 26, 2005, 23:50   #1
ArticleBot
SitePoint Articles
 
ArticleBot's Avatar
 
Join Date: Apr 2001
Posts: 0
Article Discussion

This is an article discussion thread for discussing the SitePoint article, "My Top Ten CSS Tricks"
ArticleBot is offline   Reply With Quote
Old Sep 26, 2005, 23:50   #2
EOBeav
SitePoint Zealot
 
EOBeav's Avatar
 
Join Date: May 2005
Posts: 196
An outstanding article to go along with Rachel's Andrew's fine book. I'm going to bookmark this one and refer to it next time I'm laying out a fresh style sheet. Just aof suggestion, how about a "CSS Anthology 201" from Rachel some time in the future?
EOBeav is offline   Reply With Quote
Old Sep 27, 2005, 01:37   #3
YoGi
SitePoint Community Guest
 
Posts: n/a
FFS, stop using thoses nasty CSS hacks ! Instead I suggest you to use conditional comments : http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp .
  Reply With Quote
Old Sep 27, 2005, 02:39   #4
peach
perfect = good enough
 
peach's Avatar
 
Join Date: Jun 2004
Location: -Netherlands-
Posts: 1,424
nice read, not much new in the beginning but that last tip is so useful, thats much more convenient than what I used to be doing, thanx!
peach is offline   Reply With Quote
Old Sep 27, 2005, 04:49   #5
sabif
SitePoint Member
 
Join Date: Jun 2003
Location: E Sussex, UK.
Posts: 7
Nice one, Trenton, I'll be using the last tip on a current project. Cheers!
sabif is offline   Reply With Quote
Old Sep 27, 2005, 06:35   #6
Will Kelly
SitePoint Evangelist
 
Will Kelly's Avatar
 
Join Date: May 2005
Location: London
Posts: 475
yeah I used something similar to the last tip to show an 'active' image in some graphical css navigation I did recently. Massive time saving considering my previous 'solution' was a rather complex php script.

Good article though for some reason my mobile phone won't identify itself as a handheld which is a bit annoying...
Will Kelly is offline   Reply With Quote
Old Sep 27, 2005, 07:17   #7
Tvienti
SitePoint Member
 
Join Date: Sep 2004
Location: Raleigh, NC
Posts: 2
I agree with the rest - the last tip was very useful. The rest were a great refresher. Thanks for the tips.
Tvienti is offline   Reply With Quote
Old Sep 27, 2005, 08:56   #8
Paul O'B
CSS Advisor
 
Paul O'B's Avatar
 
Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,608
We should also start thinking about ie7 now as well

Code:
  .box 
  { 
  width: 80px; 
  height: 35px; 
  } 
  
  html>body .box 
  { 
  width: auto; 
  height: auto; 
  min-width: 80px; 
  min-height: 35px; 
  }
As documented on the msdn blog ie7 will understand child selectors but so far there is no indication than min and max width/height will be implemented. Therefore the above code will fail in ie7.
Edit:

min and max width are now part of ie7 so the above comments above and below can be ignored although they were true for a while.



Conditional comments will be the only way to ensure that ie7 gets the width and height it requires (assuming of course that the characteristics of width and height aren't changed in ie7 either (which would seem to be the case))

Last edited by Paul O'B; Nov 15, 2006 at 09:41.
Paul O'B is offline   Reply With Quote
Old Sep 27, 2005, 09:13   #9
roblewis100
SitePoint Enthusiast
 
Join Date: Feb 2004
Location: UK
Posts: 33
How timely! I was tearing my hair out due to some disappearing text in I.E., but #6 helped me solve the problem. Thanks.
roblewis100 is offline   Reply With Quote
Old Sep 27, 2005, 09:15   #10
Paul O'B
CSS Advisor
 
Paul O'B's Avatar
 
Join Date: Jan 2003
Location: Hampshire UK
Posts: 26,608
Quote:
due to some disappearing text in I.E.
This is basically a "layout" issue see the faq on "haslayout" which will explain 99% of ie's bugs.
Paul O'B is offline   Reply With Quote
Old Sep 27, 2005, 16:38   #11
Javan
SitePoint Community Guest
 
Posts: n/a
Great Article! The IE Only stuff is really useful.

In tip 10 you repeated "#about .about", I bet you meant to write #contact .about
  Reply With Quote
Old Sep 27, 2005, 20:11   #12
WarpNacelle
I can't. I have rehearsal.
 
WarpNacelle's Avatar
 
Join Date: Aug 2005
Location: Seattle,WA
Posts: 346
Wow! Very nice. These always help to starting thinking in new and different directions.
WarpNacelle is offline   Reply With Quote
Old Sep 28, 2005, 06:32   #13
KeithMcL
Freelance Web Designer
 
KeithMcL's Avatar
 
Join Date: Oct 1999
Location: Dublin, Ireland
Posts: 1,208
Great Article! This has explained some of the issues I've come across in my designs. Thanks :)
KeithMcL is offline   Reply With Quote
Old Sep 28, 2005, 08:28   #14
TheLunchBox
SitePoint Enthusiast
 
TheLunchBox's Avatar
 
Join Date: Aug 2005
Location: NH
Posts: 40
This is a very well written article and was a good way for me to introduce some basic CSS-tips to some non-CSS savvy designers in my office.
TheLunchBox is offline   Reply With Quote
Old Sep 28, 2005, 12:08   #15
alexisb
SitePoint Zealot
 
alexisb's Avatar
 
Join Date: Aug 2003
Location: Lima, Peru
Posts: 143
Quote:
Originally Posted by Javan
Great Article! The IE Only stuff is really useful.

In tip 10 you repeated "#about .about", I bet you meant to write #contact .about
Hi, actually I think Trenton meant: "#contact .contact"

Regards!
alexisb is offline   Reply With Quote
Old Sep 28, 2005, 13:19   #16
haseeb
SitePoint Member
 
Join Date: Dec 2002
Location: Karachi, Pakistan
Posts: 20
Trick #10 is really new to me. Thanks Trenton (y)
haseeb is offline   Reply With Quote
Old Sep 28, 2005, 16:30   #17
gy
SitePoint Community Guest
 
Posts: n/a
Thank you for trick #6!
In vain I spent hours and days to figure out that.
  Reply With Quote
Old Sep 29, 2005, 01:47   #18
HPin
SitePoint Member
 
HPin's Avatar
 
Join Date: Apr 2005
Posts: 4
Very good article with great tricks.
Thank you
HPin is offline   Reply With Quote
Old Sep 29, 2005, 03:00   #19
all4nerds
Non-Member
 
Join Date: Jan 2005
Location: Netherlands
Posts: 4,302
Hello

tip 10

.x{/*commands for highlighted navigation go here*/}

<ul>
<li><a href="#" class="home x">Home</a></li>
<li><a href="#" class="about">About us</a></li>
<li><a href="#" class="contact">Contact us</a></li>
</ul>
all4nerds is offline   Reply With Quote
Old Sep 29, 2005, 05:50   #20
smith288
SitePoint Enthusiast
 
Join Date: Jul 2005
Posts: 41
Your tip to move content off the screen with a -1000 absolute position will get you in trouble with Google. My company got banned from search results and Google explained that as being the main culprit.
smith288 is offline   Reply With Quote
Old Sep 29, 2005, 10:22   #21
Carlo.Rinna (@gmail.com)
SitePoint Community Guest
 
Posts: n/a
Wow! your tips are brilliant! I cant wait to use some of these scripts!
  Reply With Quote
Old Sep 29, 2005, 16:43   #22
eXplosive
SitePoint Zealot
 
Join Date: Dec 2001
Location: USA
Posts: 125
#6 has been bugging me for a while. I will look into to making that fix.
eXplosive is offline   Reply With Quote
Old Sep 30, 2005, 11:26   #23
cssnut
SitePoint Member
 
Join Date: Sep 2005
Posts: 1
help with tip#10

hi, i'm mostly a beginner to CSS and i must say, i have become obsessed with it. this is my first posting.

i was so excited to try out tip#10 - same nav code on each page - but when I tried it, it didn't work for me. - I think because of this:

I have my main <ul> navigation in a div called "nav" because I have to keep the styling separate from my 'footer nav' which is also in a <ul>. (styled 'inline' and smaller text)

is there a way to make it still work by putting the id into the <body> tag?
or will it always not work if I've got the navigation inside a different div??

right now i have to span a class around the 'active' link, which has to be done manually on every page.

i would appreciate any feedback at all! thanks!
cssnut is offline   Reply With Quote
Old Sep 30, 2005, 11:59   #24
all4nerds
Non-Member
 
Join Date: Jan 2005
Location: Netherlands
Posts: 4,302
Hello

maybe this small demo helps, switch body class from a b c to d

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>12345 12345 12345 12345 12345 </title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<style type="text/css">
	.a .aa,.b .bb,.c .cc,.d .dd{color:#ff0000;}
	</style>
	<script type="text/javascript">

	</script>
</head>

<body class="d">

<div class="nav">
<a href="##" class="aa">home</a>
<a href="##" class="bb">page1</a>
<a href="##" class="cc">page2</a>
<a href="##" class="dd">page3</a>
</div>

<div class="subnav">
<a href="##" class="aa">home</a>
<a href="##" class="bb">page1</a>
<a href="##" class="cc">page2</a>
<a href="##" class="dd">page3</a>
</div>

<div class="footernav">
<a href="##" class="aa">home</a>
<a href="##" class="bb">page1</a>
<a href="##" class="cc">page2</a>
<a href="##" class="dd">page3</a>
</div>

</body>
</html>
all4nerds is offline   Reply With Quote
Old Sep 30, 2005, 22:59   #25
cssnut
SitePoint Member
 
Join Date: Sep 2005
Posts: 1
thanks for your feedback.
when I tried it, it didn't work for me.
i finally got it to work by moving my font-color from the
li a:link style to just the <li> style....weird.
cssnut is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
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
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 14:20.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved