Web Hosting Talk







View Full Version : 2 questions


johniman7
07-27-2004, 11:53 AM
1. i am usign tables for a layout. Is there a way to make 1 cell of the table to have different css effects.

2. does anyone have experience with selling templates to big template sites.

pacres
07-27-2004, 12:03 PM
If you want to create a different format for 1 cell, use a class and apply it to that cell.

CSS -

.td2 { color: #335544; }

HTML

<td class="td2"> text </td>

This is very simplistic, but should give you a good idea of what to do.

johniman7
07-27-2004, 12:08 PM
where would i put those two scripts

the_pm
07-27-2004, 12:10 PM
The CSS portion goes into your site's style sheet. The HTML portion goes...well...into your HTML.

johniman7
07-27-2004, 12:21 PM
im still confused. i need to get the link mouseover effects and stuff

the_pm
07-27-2004, 12:42 PM
These are done using CSS pseudo-classes (or sometimes a JavaScript hack in IE, since IE doesn't understand CSS standards too well).

I could vomit out a bunch of code for various CSS effects, but I'll ask this first: how far along are you with CSS? I'm assuming you're pretty new to the technology, but how new? I can point you to a number of examples from which you can rip all the code you want, but if you're just getting a handle on it, you'll need more detail than that.

Also, have you tried some basic CSS tutorials?

johniman7
07-27-2004, 12:48 PM
yeah. i use css for link effects and for some form effects and am starting to familiarize myself with it for use in layouts. thats about it. an example would be great. thats how i learn alot of stuff look at examples and learn from them.

pacres
07-27-2004, 12:58 PM
Links are a bit different.

Basic links are

a:link , a:visited, a:active, and a:hover. Hover is your mouse over effect. If you want to create classes of links, you still need to use the pseudo-classes.

CSS in the header of your html document
<style type="text/css">
<!--
a.button {color: #333333;}
a.button:link { color: #333333;}
a.button:visited {color: #aaaaaa;}
a.button:hover { color: #000000;}
a.button:active {color: #aaaaaa;}
-->
</style>

Your HTML Menu -

<a href="#" class="button">CSS Link 1</a>
<a href="#" class="button">CSS Link 2</a>
<a href="#" class="button">CSS Link 3</a>
<a href="#" class="button">CSS Link 4</a>
<a href="#" class="button">CSS Link 5</a>


Do a search on Pure CSS Navigation to find some really good tutorials.

johniman7
07-27-2004, 01:03 PM
i got it now. do i just make another class for the other links then and do change the class in the html? thanx both of oyu for your help

johniman7
07-27-2004, 01:09 PM
thats oretty much what i used before except without the classes.

the_pm
07-27-2004, 01:16 PM
Originally posted by johniman7
i got it now. do i just make another class for the other links then and do change the class in the html? thanx both of oyu for your help
Yes, and you can make things even more efficient by applying the style to a containing element around the links. i.e.:

#buttons a { CSS GOES HERE }
#buttons a:hover { CSS GOES HERE }
etc.

<div id="buttons">
<a href="somewhere.html">Go Somewhere</a>
<a href="somewhere.html">Go Somewhere</a>
<a href="somewhere.html">Go Somewhere</a>
<a href="somewhere.html">Go Somewhere</a>
<a href="somewhere.html">Go Somewhere</a>
</div>

This is called descendent selectors (or descending selectors, depending on how you use it in a sentence :) ). It not only makes your code as lean as it can possibly get, it gives you very fine control over how you style specific elements on your site. This may be worth studying in the near future, learning about how object inherit properties of parent elements, etc. It may sound complicated, but it's really not that hard to grasp at all (except IE has some trouble with inheriting, but what's new).

johniman7
07-27-2004, 01:20 PM
one more thing. how would you make the underline-overline effects .

the_pm
07-27-2004, 01:24 PM
text-decoration:underline
text-decoration:overline
text-decoration:line-through
text-decoration:blink (not commonly supported)
text-decoration:none (removes underline from links)

HTH! :)

johniman7
07-27-2004, 01:39 PM
would it be done like this

<style type="text/css">
<!--
a.button {color: #cc0000;}
a.button:link { color: #cc0000;} { text-decoration:none;}
a.button:visited {color: #cc0000;} { text-decoration:none;}
a.button:hover { color: #660000;} { text-decoration:none;}
a.button:active {color: #cc0000;} { text-decoration:none;}
-->
</style>

the_pm
07-27-2004, 02:03 PM
Close.

Try,
a.button:link { color:#cc0000 ; text-decoration:none ; }
etc.

One set of brackets for each rule.