Some Sort Of Border Is Appearing When I Use A Table - html

I'm trying to design a web page and i have a 3 column 1 row table set up (Bottom Of The Page). This is illustrated in the following figure.
As you can see in that figure, some border is appearing at the start of td tag (Marked By Black Circles). I've made the border 0 and still there is no effect. Why is happening and how should i resolve it?
I've Provided The Code Below..
HTML
<div class="wrapper col3">
<div id="intro">
<div class="fl_left">
<div class="UpperSlideShow">
</div>
<div class="LowerFlyUps">
<table class="HoverTable" cellpadding="0" cellspacing="0" border="0" style="margin-left:2px;">
<tr>
<td>
<div class="box" id="box">
<div class="inner">
<h4>Header One</h4>
<p>Content One, Team Pwn helped us identify the root cause of our problems and delivered effective solutions to tackle them.</p>
</div>
</div>
</td>
<td>
<div class="box" id="box1">
<div class="inner">
<h4>Header Two</h4>
<p>Content One, Team Pwn helped us identify the root cause of our problems and delivered effective solutions to tackle them.</p>
</div>
</div>
</td>
<td>
<div class="box" id="box2">
<div class="inner">
<h4>Header Three</h4>
<p>Content One, Team Pwn helped us identify the root cause of our problems and delivered effective solutions to tackle them.</p>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>
<div class="fl_right"><img src="images/demo/380x300.gif" alt="" /></div>
<br class="clear" />
</div>
</div>
CSS
table.HoverTable
{
border: 0px;
}
table.HoverTable tr
{
border: 0px;
}
table.HoverTable tr rd
{
border: 0px;
}
.box {
position: absolute;
bottom: 0;
width: 175px;
height: 40px;
overflow: hidden;
color: #FFFFFF;
font: 12px Tahoma,sans-serif;
background-color: #284062;
margin-right: 10px;
float: left;
text-align:center;
}
.inner {
position: absolute;
top: 0;
left: 0;
width: 100%;
}
.box h4 {
padding-bottom: 10px;
border-bottom: 1px solid #fff;
font: 18px Tahoma,sans-serif;
text-transform: capitalize;
margin: 10px;
}
.box p {
margin: 0 10px;
}
#intro
{
padding:30px 0 5px 0;
font-size:16px;
font-family:Georgia, "Times New Roman", Times, serif;
}
#intro .fl_left
{
display:block;
float:left;
width:575px;
height:300px;
margin:0;
color:#FFFFFF;
background-color:#2684B7;
}
#intro .fl_left h3
{
font-size: 24px;
padding:0;
border:none;
color:#FFFFFF;
text-align:center;
line-height:2em;
}
#intro .fl_left p
{
margin:0;
padding:0;
line-height:1.6em;
}
#intro .fl_left p.readmore
{
display:block;
width:100%;
margin:20px 0 0 0;
padding:0;
text-align:right;
line-height:normal;
}
#intro .fl_left p.readmore a
{
padding:8px 15px;
font-size:18px;
color:#FFFFFF;
background-color:#1C5E82;
}
#intro .fl_right{float:right;}
Javascript
$(document).ready(function() {
$(".box").hover(function ()
{
$(this).animate({height: 200});
}, function ()
{
$(this).animate({height: 40});
}
);
});

This is causing it, the border-left and right. http://jsfiddle.net/SdDeH/4/
table tbody td {
vertical-align: top;
border-collapse: collapse;
border-left: 1px solid #CCC;
border-right: 1px solid #CCC;
}
change to
table tbody td {
vertical-align: top;
border-collapse: collapse;
}

I was not able to duplicate your issue. But you could try adding border-collapse:collapse; to the table.
table.HoverTable
{
border: 0px;
border-collapse:collapse;
}

Related

div content table cell settings

Please find below fiddle what i tried
http://jsfiddle.net/9LdEc/
code:
html:
<div id="CorpDealerSearch">
<div class="row">
<div class="left">
Quarter To Date
</div>
<div class="left">
914
</div>
<div class="left">
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEYAAAAZCAYAAACM9limAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACoSURBVFhH7dkhDoMwFIfxJ5EcieNwG5IZJJY7IDhCBTeYm0JCgviTEJaxAUnfbL8mdVVffn0VNTMT+7KBifVdYIdCmF8YhLm5KoQhjG+KIgYxiPEVQIyvFzMGMdI4ztuOWUmJaZpBef5QllUqilZl2SmE12WnpMK8C0zTor5/qq4DYWKuz/FMkmJiIhGGVynGyecMYhCDGF8BxPh6MWMQ86cY/pXO/0or0qcGh0OW3F8AAAAASUVORK5CYII=">
</div>
<div class="left">
<span>OFF TIER2</span>
</div>
</div>
</div>
css:
#CorpDealerSearch{
display:table;
padding : 5px;
border: 2px solid gray;
border-radius:3px;
}
.row{
display:table-row;
}
.left {
display:table-cell;
display:inline-block;
padding:5px;
}
But I want the design like the screenshot below. How can I modify the fiddle to get the design like this?
I need to do changes only for the last cell.
I have updated your fiddle:
http://jsfiddle.net/9LdEc/4/
I have added some of classes to your html and used the following css:
body {
font-family: Arial;
}
#CorpDealerSearch {
display:table;
padding : 5px;
border: 2px solid gray;
border-radius:5px;
vertical-align: middle;
line-height: 25px;
}
#CorpDealerSearch a,
#CorpDealerSearch a:hover,
#CorpDealerSearch a:visited {
color: red;
font-weight: bold;
}
.row {
display:table-cell;
vertical-align: middle;
}
.left {
display:table-cell;
display:inline-block;
padding-left:5px;
padding-right: 5px;
}
.tier {
border-left: 2px dotted black;
background-color: lightgreen;
}
Is this what you wanted?

Can't make DIV float inside parent div

I've got 2 DIV elements (the ones labeled "Module" below that are not acting right! when i try to float them, so that they show up side by side, they jump outside of the parent container and fall below it. i've not been able to figure this out, can someone help?
jsfiddle: jsfiddle
HTML
<div id="contentwrap">
<div id="content">
<div>
<span style="text-align:center;">
<h2>Application Title</h2>
</span>
</div>
<br/>
<br/>
<div class="module">
<a class="modlink" href=" ../csc/index.php">
<img class="modimg" src="./images/csc.png" alt="csc"/>
<br/>Client Support Center
</a>
<br/>
</div>
<div class="module">
<a class="modlink" href=" ../icm/index.php">
<img class="modimg" src="./images/icm.png" alt="icm"/>
<br/>Inventory Control Management
</a>
<br/>
</div>
</div>
</div>
CSS
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 13px;
color:#E1E6FA;
background-color:#183152;
}
p {
padding: 10px;
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.5em;
}
h3 {
margin-bttom:2px;
}
#wrapper {
margin: 0 auto;
width: 1000px;
}
#headerwrap {
width: 1000px;
float: left;
margin: 0 auto;
}
#header {
height: 100px;
background: #375D81;
border-radius: 10px;
border: 1px solid #C4D7ED;
margin: 5px;
}
#contentwrap {
width: 820px;
float: left;
margin: 0 auto;
}
#content {
background: #ABC8E2;
border-radius: 10px;
border: 1px solid #C4D7ED;
margin: 5px;
color:black;
}
#companylabel {
margin: 10px;
top:50%;
position:absolute;
margin-top:-.5em;
}
#loginbox
{
width:100%;
}
#loginboxbot
{
width:100%;
}
.ra
{
text-align:right;
}
#borderresults {
color:orangered;
font-weight:bold;
padding:0px;
margin:0px;
border-radius:10px;
}
#alert {
background-color:yellow;
}
.module {
text-align:center;
width:120px;
padding:5px;
border-radius:5px;
border: 1px solid #E1E6FA;
color:#E1E6FA;
background-color:#375D81;
float:left;
}
.modimg {
height:100px;
width:100px;
}
.modlink {
color:#E1E6FA;
text-decoration:none;
}
It's super easy all you have to do is on content div add overflow:auto
I did it for you here and it works.
http://jsfiddle.net/alaingoldman/FAPCW/5/
#content {
...
overflow:auto;
}
enjoy and +1 me :)
Not the most elegant fix, but I added a <br style="clear:both"> below the second .module in you container and that seems to do the trick, though a violation of semantic markup.
http://jsfiddle.net/FAPCW/1/
This is a common issue and is generally fixed with a "clearfix".
Lots of versions exist. Here's one with some more details on the general issue: http://perishablepress.com/lessons-learned-concerning-the-clearfix-css-hack/
Here's even more info: https://stackoverflow.com/a/10184992/363701
heres one I use:
.cf:before, .cf:after { content: " "; display: table; }
.cf:after { clear: both; }
.cf { *zoom: 1; }
you would just put the cf class on your container, and floated children will be properly cleared.
Typical newbie stuff!
Use a div with clear both style at the end of the 'float' divs.
<div class="module">
<a class="modlink" href=" ../csc/index.php">
<img class="modimg" src="./images/csc.png" alt="csc"/>
<br/>Client Support Center
</a>
<br/>
</div>
<div class="module">
<a class="modlink" href=" ../icm/index.php">
<img class="modimg" src="./images/icm.png" alt="icm"/>
<br/>Inventory Control Management
</a>
<br/>
</div>
*<div style="clear:both"></div>*
</div>
</div>

CSS - issue with image during browser window resizing

In my example I need to keep header and main body to strech to a full screen when browser window is expanding (it works now). However, when browser window gets downsized, the orange image jumps down from the header and goes partially under black one. Any idea how to keep the orange image in place?
Here is my example: http://jsfiddle.net/RFMBM/
My CSS:
body {
background-color: #e8e8e8;
font-family: Arial, Helvetica, sans-serif;
font-size:12px;
padding: 0;
margin: 0;}
h1 {
padding: 0px;
margin: 0px;
}
#container {
margin:0px auto;
border:0px solid #bbb;
padding:10px;
min-width: 990px;
}
.white-box {
width: 180px;
margin: 0px;
}
#main-header {
border:1px solid #bbb;
height:98px;
padding:3px;
background-color: #fff;
min-width: 930px;
}
#main-content {
margin-top:10px;
padding-bottom:10px;
}
#main-body {
margin-left:10px;
width:666px;
height:150px;
}
#main-footer {
margin-top:10px;
margin-bottom:10px;
padding:10px;
border:1px solid #bbb;
}
.box {
padding: 8px;
border: 1px solid silver;
-moz-border-radius: 8px;
-o-border-radius: 8px;
-webkit-border-radius: 5px;
border-radius: 8px;
background-color: #fff;
}
.box1 {
width: 200px;
float: left;
}
.box2 {
margin-left: 224px;
}
div.left {
float: left;
}
div.right {
float: right;
margin-right:3px;
}
HTML:
<div id="main-header">
<div class="left"><img src="http://img89.imageshack.us/img89/2675/logoxnx.gif" border="0" alt=""></div>
<div class="right"><img src="http://img199.imageshack.us/img199/9759/banner2b.gif" border="0" alt=""></div>
</div>
<div id="container">
<div id="main-content">
<div class="box box1">
left
</div>
<div class="box box2">
<p>Main Body...</p>
</div>
<div style="clear:both;"></div>
</div>
<div id="main-footer">Main Footer</div>
</div>
You need to increase the min-width of #main-header to around 950px
http://jsfiddle.net/RFMBM/2/

Having issues positioning divs

This is basically what I want. Record ID on the left, then the actual post on the right. Instead I get this.
body{
background-color: #333333;
color: #ffffff;
font-family: Arial, Helvetica, sans-serif;
font-size: 16pt;
}
h2{
display:inline;
}
h2 a{
color:#ffffff;
}
hr{
border: 1px solid #db8039;
}
.post {
margin-left:auto;
margin-right:auto;
width: 66%;
background-color: #1a1a1a;
border-radius:10px;
font-size: 15px;
padding: 10px 10px 5px 10px;
}
.button{
background: -webkit-gradient(linear, left top, left bottom, from(#333), to(#222));
background: -moz-linear-gradient(top, #333, #222);
color:#888;
height:40px;
}
div.test{
border: 1px solid white;
}
<div id="post'.$row['postId'].'" class="post">
<div id="left" style="float:left">
<h2>0</h2>
</div>
<div id="right">
<div style="float:left;">
<h2><a href=#>TITLE</a></h2>
</div>
<div style="float:right;">
Posted By: USER on DATE
</div>
<br style="clear:both;"/>
<hr />
<p>BODY</p>
</div>
</div>
I'm sure this is extremely simple to do, I am just at a loss, my CSS skills are... sub par I suppose.
Any help would be greatly appreciated! Thanks!
I made a complete new 1 if you wish to check it out
Demo
Edit: New Demo
HTML
<div class="container">
<div class="count">1</div>
<div class="upper">Test 2</div>
<hr>
<div class="down">Body</div>
</div>
CSS
.container {
width: 500px;
height: 100px;
background: #000;
position: relative;
}
.count {
float: left;
color: #fff;
font-size: 30px;
line-height: 100px;
width: 50px;
text-align: center;
}
.upper {
color: #fff;
font-size: 22px;
line-height: 40px;
}
.down {
color: #fff;
font-size: 22px;
line-height: 40px;
}
Though I don't recommend to use this, it will be pretty easier to achieve this using tables too
Table Demo
HTML
<table border="1">
<tr>
<td rowspan="2"> </td>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
CSS
table {
width: 50%;
margin: 30px;
}
table tr:nth-child(1) td:nth-child(1) {
width: 100px;
}
Try adding the following rules:
#left{
width:5%;
display:inline-block
}
#left h2{
font-size:40px;
}
#right{
width:94%;
display:inline-block
}
jsfiddle: http://jsfiddle.net/dPX8J/15/

creating the same thing with divs as tables

I started looking into CSS more deeply and decided I would like to convert my site's html that mainly consists of tables to divs.
I'm trying to accomplish the same thing with divs as with tables on this test page. But I'm having a few problems:
Couldn't make columns
Vertical text alignment
How far I've gotten:
Code:
<style type="text/css">
body {
background-color:#000;
}
/* TABLE CSS */
td {
font-family: Tahoma;
font-size: 12px;
}
.line {
border-collapse:separate;
border:1px solid #222222;
border-spacing:1px 1px;
margin-left:auto;
margin-right:auto;
background-color: #000000;
padding: 1px;
width:400px;
}
.topic {
background-color:#3C0;
font-weight: bold;
height: 23px;
color:#FFF;
text-align:center;
}
.row {
background-color: #111111;
border-bottom: 1px solid black;
color: #ffffff;
height:12px;
line-height:21px;
padding:0px;
}
.row:Hover {
background-color: #252525;
}
/* DIV CSS */
div.line {
border-collapse:separate;
border:1px solid #222222;
border-spacing:1px 1px;
align:center;
background-color: #000000;
padding: 1px;
width:400px;
}
div.topic {
background-color:#3C0;
font-family: Tahoma;
font-size: 12px;
height: 23px;
font-color:#FFF;
text-align:center;
}
div.row {
background-color: #111111;
border-bottom: 1px solid black;
color: #ffffff;
padding:6px;
font-family: Tahoma;
font-size:12px;
}
div.row:Hover {
background-color: #252525;
}
</style>
<body>
<table class="line">
<tbody>
<tr>
<td class="topic" colspan="3">Table</td>
</tr>
<tr class="row">
<td width="20%" align="left">Test</td>
<td width="20%" align="center">1</td>
</tr>
<tr class="row">
<td align="left">Test</td>
<td align="center">2</td>
</tr>
</tbody>
</table>
<p>
<div class="line">
<div class="topic">Div</div>
<div class="row">Test</div><div class="row">1</div>
<div class="row">Test</div><div class="row">2</div>
</div>
</p>
It's good to see that you are converting tables into divs, however make sure you only do this where necessary.
If the data on the page is tabular, then it makes sense for this to be put in a table element.
Div's are for layout and structure, table's are for displaying tabular data.
A collegue of mine once spent ages building a forum out of divs which followed a table structure. This was all because he'd been told "tables are bad, use divs and CSS". It's important to remember this is only referring to layout structure.
If your structure has rows and columns, then use a table. tables are still valid useful HTML elements, and are far from deprecated.
Here you go:
HTML:
<div id="wrap">
<h2> Div </h2>
<div class="section">
<div> Test </div>
<div> 1 </div>
</div>
<div class="section">
<div> Test </div>
<div> 2 </div>
</div>
</div>
CSS:
#wrap {
border: 2px solid #333;
padding: 2px;
}
h2 {
background: green;
color: white;
text-align: center;
font-weight: bold;
padding: 4px 0;
}
.section {
overflow: auto;
margin-top: 2px;
}
.section > div {
float:left;
width: 50%;
box-sizing: border-box;
-moz-box-sizing: border-box;
background-color: #333;
color: white;
padding: 4px 0;
}
.section > div + div {
text-align: center;
border-left: 2px solid black;
}
Live demo: http://jsfiddle.net/jNQrM/1/
Get a good book - I recommend CSS: The Missing Manual (Missing Manuals)
look up float a long with display esp relative
Put float:left; on this class :
div.row
Take a look to the css display property.
.line {
display: table;
}
.row {
display: table-cell;
}
But you should get some problems with internet explorer. In that caase you could use display: inline; with a zoom:1;