Subscribe to our mailing list

* indicates required

Fun CSS Tricks You Can Use!

Posted on February 6, 2001

by Dan Grossman

CSS or Cascading Style Sheets allow you to implement a few neat effects on your webpages easily. You can implement these CSS effects on your site by simply copying and pasting the code.

Rollover Color Text Links

Have your text links change color when the mouse passes over them by inserting this code into the HEAD of your document:

<style type="text/css">
<!--
A:hover {color:red}
-->
</style>

Links With No Underline

Remove the underline from any or all of the links on your page by putting this in the HEAD of your document:

<style type="text/css">
<!--
A:link {text-decoration:none}
A:visited {text-decoration:none}
-->
</style>

Or, remove the underline form individual links by forming them like this:

<a href="page.html" style="text-decoration: none">link</a>

Links With A Line Above And Below Them

This is an interesting look that works especially well as a hover attribute for your links, but can also be applied to all of your links. It will show the normal underline and a line above the link:

<style type="text/css">
<!--
A:hover {text-decoration:overline underline}
-->
</style>

Highlighted Text

Highlight important text on your page or words you want to stand out, easily:

<span style="background-color:yellow">highlighted text</span>

Try adding it to your link hover for a neat effect:

<style type="text/css">
<!--
A:hover {background-color: orange}
-->
</style>

Background Image That Isnt Tiled

This will create a background image that doesn't repeat:

<style type="text/css">
<!--
BODY {background: #ffffff url(bg.gif) no-repeat}
-->
</style>

You can also center it, however it will be centered as the background of the entire document, not centered on the screenful:

<style type="text/css">
<!--
BODY {background: #ffffff url(bg.gif) no-repeat center}
-->
</style>



Dan Grossman runs http://www.websitegoodies.com where you can find over 250 hand-picked resources, articles, and tools! Dan also publishes the free weekly "WebDevPortal" newsletter for website owners! Subscribe today and get articles like this every week: mailto:subscribe@webdevportal.com?subject=article-subscribe

 

blog comments powered by Disqus
Keyword Discovery - Keyword Research Tool Buy Traffic
Trellian Direct Search Network Domain Parking Manager - Make more from parking
Submit your website to 20 popular
search engines for FREE!
Directory Submission
Start promoting your business! A directory listing can improve visibility to your website. The AddMe Business Directory is one of the fastest growing business directories offering quality, SEO-friendly listings.

Join our free bi-monthly newsletter full of tips and advice to better succeed online!

Need help improving your website's organic rankings in the search engines? Our SEO experts are ready to jumpstart your campaign to increase traffic and sales on your site.
Poll
Do you rely on Google Local Search for your business?
1. Yes
2. No
to see the Poll results!