What is the difference between doing this:
.bg {
and
#bg {
When using <div class="bg"> .... </div>
The .bg applies to that div, and #bg does not.
. means class, and # means id.
.bg == <anything class="bg" />
#bg == <anything id="bg" />
Ok thanks and what really is the difference between class and id?
Ok thanks and what really is the difference between class and id?
<style>
#main {width: 800px;}
.content {width: 500px;}
</style>
<div id="main" class="content"></div>
A couple of issues, your html is malformed. The tags are in the wrong sequence.And why doesn't this work:
Html:
<tr>
<table class="table1">
<th>Model</th>
<th>Specs</th>
<th>Description</th>
<th>Power</th>
<th>Operating System</th>
<th>Price</th>
</tr>
</table>
CSS:
.table1 {
border-width: 5px thin medium thick;
font: bold 12pt;
background-color:blue;
}
.table1 {
border:1px solid #000;
}
.table1 {
border-width:1px;
border-style:solid;
border-color:#000;
}
<tr> <table class="table_title">
<th>Specs</th>
<th>Description</th>
<th>Power</th>
<th>Operating System</th>
<th>Price</th>
</table> </tr>
<table class="row">
<td>Next Gen 1.0 (2012)</td>
<td>(1)Intel i8 processor 12 core @3.5 GHz, 16 GBs of Ram, 2 TBs of Hard drive</td>
<td>This is our Next Gen 1.0 Model, you can order the case in black or white</td>
<td>More powerful then your grandmas computer.</td>
<td>Waloshin Distro based on Linux 64 bit</td>
<td>$6000 including tax</td>
<tr>
<html>
<head>
<style type="text/css">
table {background-color: #FFFFCC;}
.row>td {border-bottom: 1px solid #333;}
.table_title{color: #FFF;background-color: #666;}
.price {color: red;}
</style>
</head>
<body>
<!-- table starts here -->
<table cellpadding="5" cellspacing="0">
<tr class="table_title"> <!-- begin the heading row -->
<th>Model</th> <!-- Our 6 column headers are listed here-->
<th>Specs</th>
<th>Description</th>
<th>Power</th>
<th>Operating System</th>
<th>Price</th>
</tr> <!-- end of heading row -->
<tr class="row"> <!-- begin the data rows -->
<!-- Our 6 data columns are listed below -->
<td><strong>Next Gen 1.0 (2012)</strong></td>
<td>(1)Intel i8 processor 12 core @3.5 GHz, 16 GBs of Ram, 2 TBs of Hard drive</td>
<td>This is our Next Gen 1.0 Model, you can order the case in black or white</td>
<td>More powerful then your grandmas computer.</td>
<td>Waloshin Distro based on Linux 64 bit</td>
<td><span class="price">$6000</span> including tax</td>
</tr><!-- end the first data row here -->
<!-- to add another data row we need to add <tr> tags and the 6 columns -->
<tr class="row">
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
</tr>
</table> <!-- table ends here -->
</body>