PDA

View Full Version : Ending a .css code...


Cascade
03-23-2003, 12:28 AM
Allright fuys,

I have inserted this into my page....

<style type="text/css">
<!--
.bordercolor { width: 85%; }
-->
</style>



How can I end that code... Or have a selected span where it is not in effect? (Like a table )


- Mike

brothercake
03-23-2003, 12:33 AM
You can apply element classes:

div.bordercolor { width: 85%; }

applies only to a DIV with that class

Cascade
03-23-2003, 12:40 AM
Originally posted by brothercake
You can apply element classes:

div.bordercolor { width: 85%; }

applies only to a DIV with that class

Sorry I am no genius at .css,

It would be like this?

<style type="text/css">
<!--
.divbordercolor { width: 85%; }
-->
</style>


And at the start of the table...


<table align="CENTER" class="divbordercolor">




- Mike

brothercake
03-23-2003, 12:51 AM
No;

div.bordercolor {}

(notice where the dot is) applies to

<div class="bordercolor">

but *not* to

<table class="bordercolor">


But

.bordercolor {}

applies to any element with class="bordercolor"


See? It goes

element.className {}

to apply the rule to

<element class="className">


Yes? :)

Cascade
03-23-2003, 01:04 AM
How do I end the div.border?



</div>?

Do I even need to end it?



- Mike

Cascade
03-23-2003, 01:07 AM
This is what I got so far....


-----------------------------------------

<style type="text/css">
<!--
div.bordercolor { width: 100%; }
-->
</style>
<style type="text/css">
<!--
.bordercolor { width: 80%; }
-->
</style>


<div align=center><table width=100%><tr><td width=5%></td><td><div class="bordercolor">


TABLE INFO HERE

</td></tr></table>

brothercake
03-23-2003, 01:52 AM
Try the w3schools HTML tutorial at http://www.w3schools.com/html/html_intro.asp - it should help you get started

cg9com
03-23-2003, 03:48 AM
<div> is a division, a box. so if you used the class="" in its attributes you would border that div box, because of your CSS tree. so whatever is inside of <div class=""></div> will have the border you have specified. beucase <div> starts it and </div> ends it.
if you go to that w3schools website then read on CSS as well.