Navigation Button

Internet Brothers: Helpware for the Cybercommunity - Cascading Style Sheets

Style Sheets 104

What's this have to do with CSS? CSS, or Cascading Style Sheets, is a newer technology that gives site builders enhanced control over the look of elements on a web page. Objects once considered unchangeable, such as the underline beneath links, the color of form elements, the spacing between text, and more, can now all be altered, thanks to CSS. As good as this technology sounds, its use by web authors is actually very limited at this point. The problem is not CSS, but rather, the browsers used to render CSS. No browser on the Net presently fully supports CSS (including both Internet Explorer 4 and Netscape Navigator 4). Until IE and NN comply with standards and embrace CSS so it will function as designed by the World Wide Web Consortium, its simply not worth the effort to incorporate too much CSS into a web site. Because of this, what you'll likely find as you roam around the Net these days are sites with just a touch of CSS, including this one. In this article, we'll demonstrate some easy, relatively safe CSS examples. For a more basic understanding of CSS properties, go to our Dynamic HTML section.

No-underline Links - compatability: IE4+ and NN4+

One of the very first indicators that CSS had arrived was when people browsing the web began reporting a strange phenomena on some sites they surfed -- the text links on those sites did not have an underline! We now know that this is enabled by CSS, and below is the code you can use to achieve the same effect. Add it to the <head> section of your page:

<style>
a{
text-decoration:none;
}
</style>

Rollover Text Links - compatability: IE4+

With the huge popularity surrounding rollover image effects, it's no wonder people ask how to create rollover text links. IE4+ supports CSS-P, a modified version of CSS that allows you to easily give your text links a rollover personality. The link changes color when the mouse cursor hovers over it. Here's the source code for this effect:

<style>
#changestyle a:hover{
color:green;
}
</style>

Like the first code, this should be inserted in the <head> section of your page. You can change the keyword "green" to your liking. Here's an example of a rollover link. Refer back to the changestyle style declaration id in your block element:

<p id="changestyle">Hover your mouse cursor . . . </p>

Hover your mouse cursor over this text if you're using IE 4+


Highlight Text - compatability: IE4+ and NN4+

As you've noticed throughout our site, Internet Brothers likes to use this technique to assist with page layout. It's a nice effect that works in both 4+ browsers, and won't have a negative effect on those not capable of CSS.

Since we want to emphasize the words "Internet Brothers likes to use this", we use style attributes to give that portion of the text a background color of yellow. Here's the source code we used:

<span style="background-color:yellow">
Internet Brothers likes to use this
</span>

As you can see, just surround the text you want to highlight with the part in bold.

Continue With Fancier Tricks

previous page     top of page     next page

The Internet Brothers have implemented hierarchical menus for navigation. Easier done than said.

The hierarchical menus were created using Peter Belesis' © Dynomat DHTML scripting tool from Webreference. Give them a visit, you'll like what you learn.

Our Lovely Email Icon    another darn bug

HTML Utopia: Designing Without Tables Using CSS
HTML Utopia: Designing Without Tables Using CSS
  • Learn to use CSS for layout
  • Build faster loading, leaner pages
  • Produce clean, beautifully managed code
  • Design device-independent, highly accessible pages
  • Write standards compliant code
Download sample
chapters free!


Read more info







Site Map

 

 

 

 

Was this site useful to you?
Vote For Us at WebbieWorld

 

 

Copyright © 1997-present Internet Brothers. All Rights Reserved. Really.