I'm learning html & css and I downloaded a PSD File to convert to code but I'm having a little problem:
I have my table but I need to know, how can i do one space here?
In this link i have the HTML and CSS code: http://jsbin.com/rupih/1/edit
I'm learning html & css and I downloaded a PSD File to convert to code but I'm having a little problem:
I have my table but I need to know, how can i do one space here?
In this link i have the HTML and CSS code: http://jsbin.com/rupih/1/edit
To change the width of that space in a table using CSS you would use
table {
border-spacing: 10px;
border-collapse: separate;
}
For more info see: Set cellpadding and cellspacing in CSS?
However as you haven't realy got tabular data and more of a list, I would use a list:
HTML
<ul class="products">
<li>
<h2>Abercrombie & Fitch</h2>
<img src="http://dotacionesindustriales.net/images/4002%20Camisa%20Manga%20Corta%20Hombre-Oxford.jpg" />
<div>
<span class="price"><b>Price:</b> US $65</span>
<span class="COD"><b>COD:</b> AE001 </span>
</div>
</li>
<li>
<h2>Hollister</h2>
<img src="http://dotacionesindustriales.net/images/4002%20Camisa%20Manga%20Corta%20Hombre-Oxford.jpg" />
<div>
<span class="price"><b>Price:</b> US $65</span>
<span class="COD"><b>COD:</b> AE001 </span>
</div>
</li>
<!-- etc -->
</ul>
CSS
ul.products
{
list-style:none;
margin:0;
padding:0;
}
.products li
{
float:left;
margin-right:1em;
margin-bottom:1.2em;
}
.products li img
{
padding:6px;
background-color: #e9f1f8;
border: 1px solid #d3e6f6;
}
.products li h2
{
color: #325A8C;
font-size:16px;
text-align:center;
font-family:serif;
}
.products li div
{
font-weight:bold;
}
.products li div .price
{
color: #349031;
}
.products li div .COD
{
color: #44403F;
float:right;
padding-right: 1.5em;
}
.products li div .price b, .products li div .COD b
{
color:#000;
}
The most important part in regards to your original question is:
.products li
{
float:left;
margin-right:1em; /*Adjust this value to change the horizontal Spacing*/
margin-bottom:1.2em;
}
Apart from being more semantic html, you get the added advantage of a fluid layout. If three products don't fit across the page it will adjust the layout accordingly. Similarly it will accomodate more if they will fit.
See it in action here: http://jsfiddle.net/b9evg/