Overlapping Divs in HTML [closed] - html

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I want the Divs to work relative to each other. The divs are overlapping when I add rows in gridview. You can see the problem in the image. I am not good at html/css. Kindly help me out.
This is the HTML:
<section id="section-1" class="content-current" onclick="setTabIndex(1)">
<div class="left-side">
<div class="women_main">...</div>
<br />
</div>
<div class="right-side">
<div class="w_content">...</div>
</div>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<div class="women_main">...</div>
</section>
CSS:
.right-side {
width:50%;
float:right;
margin-top:0px;
padding-top:0px;
}
.left-side{
width:50%;
float:left;
}
.women_main {
-webkit-box-shadow: 0px 0px 2px 1px rgba(37, 37, 37, 0.39);
box-shadow: 0px 0px 2px 1px rgba(37, 37, 37, 0.39);
padding: 1em;
border: 2px solid #e3e3e3 !important;
}

You should really clear the floats. Don't give so many <br /> for getting to the right layout. The solution is to use clear: both on the .women_main.
Initial Look:
.right-side {
width: 50%;
float: right;
margin-top: 0px;
padding-top: 0px;
}
.left-side {
width: 50%;
float: left;
}
.women_main {
clear: both;
-webkit-box-shadow: 0px 0px 2px 1px rgba(37, 37, 37, 0.39);
box-shadow: 0px 0px 2px 1px rgba(37, 37, 37, 0.39);
padding: 1em;
border: 2px solid #e3e3e3 !important;
}
<section id="section-1" class="content-current" onclick="setTabIndex(1)">
<div class="left-side">
<div class="women_main">...</div>
<br />
</div>
<div class="right-side">
<div class="w_content">...</div>
</div>
<div class="women_main">...</div>
</section>
When the right side is too long:
.right-side {
width: 50%;
float: right;
margin-top: 0px;
padding-top: 0px;
height: 600px;
}
.left-side {
width: 50%;
float: left;
}
.women_main {
clear: both;
-webkit-box-shadow: 0px 0px 2px 1px rgba(37, 37, 37, 0.39);
box-shadow: 0px 0px 2px 1px rgba(37, 37, 37, 0.39);
padding: 1em;
border: 2px solid #e3e3e3 !important;
}
<section id="section-1" class="content-current" onclick="setTabIndex(1)">
<div class="left-side">
<div class="women_main">...</div>
<br />
</div>
<div class="right-side">
<div class="w_content">...</div>
</div>
<div class="women_main">...</div>
</section>
You could find that both adapt correctly to the height.

I have worked out on your code and attached herewith the codepen link. Please check, I hope this will help you.
HTML
<section id="section-1" class="content-current" onclick="setTabIndex(1)">
<div class="left-side">
<div class="women_main">... LEFT CONTENT ...</div>
</div>
<div class="right-side">
<div class="women_main">... RIGHT CONTENT ...</div>
</div>
</section>
<section class="two">
<div class="">... SECTION2 ...</div>
</section>
CSS
.content-current, .two {
width: 100%;
position: relative;
border:1px solid #000;
height:100px;
}
.left-side {
width: 49%;
float: left;
border: 1px solid red;
}
.right-side {
width: 49%;
float: right;
border: 1px solid blue;
}
.women_main {
-webkit-box-shadow: 0px 0px 2px 1px rgba(37, 37, 37, 0.39);
box-shadow: 0px 0px 2px 1px rgba(37, 37, 37, 0.39);
padding: 1em;
border: 2px solid #e3e3e3 !important;
}
.content-current:after {
clear:both;
}
.two {
margin-top: 10px;
background: #ccc;
}
http://codepen.io/WebTechie/pen/EZxNwJ

Related

How to set bootstrap input responsive width?

I need to do an inline form with calendar in both fields. for some reason i can't get rid of the extra space between the text and the borders of the input... here is a picture of the problem
I've tried to set width to the parent div and the input itself.... but no good..
Here is what I've done so far. Fiddle:
<div class="modify_search">
<div class="search_wrapper">
<div class="search_header">
<form class="form-inline">
<div class="left">
<span>DU</span>
<div class="input-group">
<input type="text" class="form-control search_input" id="inlineFormInputGroup">
<div class="input-group-addon">
<i class="fa fa-calendar" aria-hidden="true"></i>
</div>
</div>
</div>
<div class="right">
<span>DU</span>
<div class="input-group">
<input type="text" class="form-control search_input" id="inlineFormInputGroup">
<div class="input-group-addon">
<i class="fa fa-calendar" aria-hidden="true"></i>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
Here is the css :
.search_input {
border: none;
outline: none;
font-size: 24px;
box-shadow: none;
}
.search_input:focus {
box-shadow: none;
}
.modify_search {
overflow: hidden;
position: absolute;
background-color: white;
width: 60vw;
height: 37vh;
left: 50%;
bottom: 5%;
transform: translate(-50%, 0%);
border-radius: 10px;
-webkit-box-shadow: 0px 0px 28px -5px rgba(0, 0, 0, 0.75);
-moz-box-shadow: 0px 0px 28px -5px rgba(0, 0, 0, 0.75);
box-shadow: 0px 0px 28px -5px rgba(0, 0, 0, 0.75);
}
.left,
.right {
margin-right: 15px;
border-bottom: 1px solid grey;
}
.left {
float: left;
}
.right {
float: right;
}
.search_header {
padding: 15px 15px 0px 15px;
}
.input-group-addon {
background-color: white;
border: none;
}
As you're using bootstrap you have to apply the witdh to the input-group if you have another input-group with diferent width, just add a id to parent div and filter css class with that id
#less-width .input-group{
width: 180px !important;
}
http://jsfiddle.net/duj0s5ev/8/
Or you can add it to a bootstrap column that fills the desired width
http://jsfiddle.net/duj0s5ev/11/

What i am doing wrong in table with divs

What i am doing wrong with this table constructed with divs?
Why header row and cell row don't have the same width?
Another problem is, when resizing browser window header an cell losing their justify. I'd like to have the same movement for both header and cells.
if you resize your browser window you will see borders moving different.
here is my code
html, body {
width: 100%;
height: 95vh;
overflow: hidden;
background-color: rgba(31, 30, 30, 1);
}
.records {
width: 99%;
overflow-x: hidden;
overflow-y: auto;
}
.header-cell {
display: inline-block;
width: 9%;
height: 20px;
margin-top: 2px;
margin-left: -4px;
border: 1px solid #fff;
background: #3a3a3a;
color: #fff;
white-space: nowrap;
}
.cell {
display: inline-block;
width: 9%;
height: 20px;
margin-top: 2px;
margin-left: -4px;
border: 1px solid #fff;
background: #ccc;
color: #494949;
white-space: nowrap;
}
.header {
position: fixed;
width: 100%;
}
.row1 {
padding-top: 4px;
}
/* scrollbars */
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-track {
-webkit-border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
-webkit-border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);
border-radius: 10px;
background: rgba(204, 51, 0, .9);
}
::-webkit-scrollbar-thumb:window-inactive {
background: rgba(255, 0, 0, .4);
}
/* scrollbars */
::-webkit-scrollbar {
width: 5px;
}
::-webkit-scrollbar-track {
-webkit-border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
border-radius: 10px;
}
::-webkit-scrollbar-thumb {
-webkit-border-radius: 10px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);
border-radius: 10px;
background: rgba(204, 51, 0, .9);
}
::-webkit-scrollbar-thumb:window-inactive {
background: rgba(255, 0, 0, .4);
}
<div class="records">
<div class="header">
<div class="header-cell">#</div>
<div class="header-cell">Movie</div>
<div class="header-cell">Distributor</div>
<div class="header-cell">Country</div>
<div class="header-cell">Language</div>
<div class="header-cell">Name</div>
<div class="header-cell">Role</div>
<div class="header-cell">Born</div>
<div class="header-cell">Star Sign</div>
<div class="header-cell">Episodes</div>
</div>
<div style="padding-top:19px;">
<div class="cell">145</div>
<div class="cell">Game Of Thrones</div>
<div class="cell">HBO</div>
<div class="cell">USA</div>
<div class="cell">English</div>
<div class="cell">
Peter Dinklage
</div>
<div class="cell">Tyrion Lannister</div>
<div class="cell">June 11, 1969</div>
<div class="cell">Gemini</div>
<div class="cell">2-3-4-6-11</div>
</div>
<div style="padding-top:1px;">
<div class="cell">146</div>
<div class="cell">Game Of Thrones</div>
<div class="cell">HBO</div>
<div class="cell">USA</div>
<div class="cell">English</div>
<div class="cell">
Kit Harington
</div>
<div class="cell">Jon Snow</div>
<div class="cell">December 26, 1986</div>
<div class="cell">Capricorn</div>
<div class="cell">1-2-3-6-9</div>
</div>
</div>
I have updated your html and styles, The width of the entries row and the float: left; used instead of display: inline-block;
HTML
<div class="records" >
<div class="header">
<div class="header-cell">#</div>
<div class="header-cell">Movie</div>
<div class="header-cell">Distributor</div>
<div class="header-cell">Country</div>
<div class="header-cell">Language</div>
<div class="header-cell">Name</div>
<div class="header-cell">Role</div>
<div class="header-cell">Born</div>
<div class="header-cell">Star Sign</div>
<div class="header-cell">Episodes</div>
</div>
<div style="padding-top:19px;width:100%">
<div class="cell">145</div>
<div class="cell">Game Of Thrones</div>
<div class="cell">HBO</div>
<div class="cell">USA</div>
<div class="cell">English</div>
<div class="cell">Peter Dinklage</div>
<div class="cell">Tyrion Lannister</div>
<div class="cell">June 11, 1969</div>
<div class="cell">Gemini</div>
<div class="cell">2-3-4-6-11</div>
</div>
<div style="padding-top:1px;width:100%">
<div class="cell">146</div>
<div class="cell">Game Of Thrones</div>
<div class="cell">HBO</div>
<div class="cell">USA</div>
<div class="cell">English</div>
<div class="cell">Kit Harington</div>
<div class="cell">Jon Snow</div>
<div class="cell">December 26, 1986</div>
<div class="cell">Capricorn</div>
<div class="cell">1-2-3-6-9</div>
</div>
</div>
Style
html,body {
width:100%;
height:95vh;
background-color: rgba(31,30,30,1);
overflow:hidden;
}
.records {
width:99%;
overflow-x:hidden;
overflow-y:auto;
}
.header-cell {
height: 20px;
width: 9%;
background: #3a3a3a;
color: #ffffff;
/* display: inline-block; */
/* margin-left: -4px; */
white-space: nowrap;
border: 1px solid #fff;
/* margin-top: 2px; */
float: left;
}
.cell {
height: 20px;
width: 9%;
background: #cccccc;
color: #494949;
/* display: inline-block; */
/* margin-left: -4px; */
float: left;
white-space: nowrap;
border: 1px solid #fff;
/* margin-top: 2px; */
}
.header {
/*position:fixed; */
width:100%;
}
.row1 {
padding-top:4px;
}
/* scrollbars */
::-webkit-scrollbar {width: 5px;}
::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); -webkit-border-radius: 10px; border-radius: 10px;}
::-webkit-scrollbar-thumb {-webkit-border-radius: 10px; border-radius: 10px; background: rgba(204,51,0,0.9); -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
::-webkit-scrollbar-thumb:window-inactive { background: rgba(255,0,0,0.4); }
/* scrollbars */
::-webkit-scrollbar {width: 5px;}
::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); -webkit-border-radius: 10px; border-radius: 10px;}
::-webkit-scrollbar-thumb {-webkit-border-radius: 10px; border-radius: 10px; background: rgba(204,51,0,0.9); -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
::-webkit-scrollbar-thumb:window-inactive { background: rgba(255,0,0,0.4); }
Refer the update fiddle :
https://jsfiddle.net/5Ldv5m1a/3/
This is a highly unconventional way of making a table. HTML has the <table> element where tables have <tr> (table row) elements and <td> (table cell) elements. The layout would look like this:
<table class="tabName">
<tr class="header">
<td>Element1</td>
<td>Element2</td>
<td>Element3</td>
<td>Element4</td>
</tr>
<tr>
<td>Element1</td>
<td>Element2</td>
<td>Element3</td>
<td>Element4</td>
</tr>
<tr>
<td>Element1</td>
<td>Element2</td>
<td>Element3</td>
<td>Element4</td>
</tr>
</table>
This will create 2 rows with 4 elements in each row excluding the header. Using the class name for the first table row, you can set special CSS specs on the header and other rules for the non-headers. If you want CSS rules for just the header use this:
.header td{
/*header styles*/
}
If you want to style the cells that are not part of the header use this CSS rule:
td:not(.header td){
/*non-header cell styles*/
}
For future reference, keep in mind that divs are only used to "package" a set of elements together when they share a common set of rules. So avoid rewriting the same rules for multiple elements by using the same class names for both or grouping them within a div. For example, if you have Ok and Cancel buttons together, you would put them inside a div because they will use exact same CSS rules except for the button color.
Try this
.records {
display: table;
overflow-x: hidden;
overflow-y: auto;
width: 100%;
}
.btlrow {
display: table-row;
}
.cell {
background: #cccccc none repeat scroll 0 0;
border: 1px solid #fff;
color: #494949;
display: table-cell;
height: 20px;
margin-top: 2px;
white-space: nowrap;
}
/* scrollbars */
::-webkit-scrollbar {width: 5px;}
::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); -webkit-border-radius: 10px; border-radius: 10px;}
::-webkit-scrollbar-thumb {-webkit-border-radius: 10px; border-radius: 10px; background: rgba(204,51,0,0.9); -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
::-webkit-scrollbar-thumb:window-inactive { background: rgba(255,0,0,0.4); }
/* scrollbars */
::-webkit-scrollbar {width: 5px;}
::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); -webkit-border-radius: 10px; border-radius: 10px;}
::-webkit-scrollbar-thumb {-webkit-border-radius: 10px; border-radius: 10px; background: rgba(204,51,0,0.9); -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
::-webkit-scrollbar-thumb:window-inactive { background: rgba(255,0,0,0.4); }
<div class="records" >
<div class="btlrow">
<div class="cell">#</div>
<div class="cell">Movie</div>
<div class="cell">Distributor</div>
<div class="cell">Country</div>
<div class="cell">Language</div>
<div class="cell">Name</div>
<div class="cell">Role</div>
<div class="cell">Born</div>
<div class="cell">Star Sign</div>
<div class="cell">Episodes</div>
</div>
<div class="btlrow">
<div class="cell">145</div>
<div class="cell">Game Of Thrones</div>
<div class="cell">HBO</div>
<div class="cell">USA</div>
<div class="cell">English</div>
<div class="cell">Peter Dinklage</div>
<div class="cell">Tyrion Lannister</div>
<div class="cell">June 11, 1969</div>
<div class="cell">Gemini</div>
<div class="cell">2-3-4-6-11</div>
</div>
<div class="btlrow">
<div class="cell">146</div>
<div class="cell">Game Of Thrones</div>
<div class="cell">HBO</div>
<div class="cell">USA</div>
<div class="cell">English</div>
<div class="cell">Kit Harington</div>
<div class="cell">Jon Snow</div>
<div class="cell">December 26, 1986</div>
<div class="cell">Capricorn</div>
<div class="cell">1-2-3-6-9</div>
</div>
</div>
Your code need few changes in the CSS file and few CSS changes in HTML file. Below are the changes.
HTML:
<div class="records" >
<div class="header">
<div class="header-cell">#</div>
<div class="header-cell">Movie</div>
<div class="header-cell">Distributor</div>
<div class="header-cell">Country</div>
<div class="header-cell">Language</div>
<div class="header-cell">Name</div>
<div class="header-cell">Role</div>
<div class="header-cell">Born</div>
<div class="header-cell">Star Sign</div>
<div class="header-cell">Episodes</div>
</div>
<div style="padding-top:19px;display: table-row;">
<div class="cell">145</div>
<div class="cell">Game Of Thrones</div>
<div class="cell">HBO</div>
<div class="cell">USA</div>
<div class="cell">English</div>
<div class="cell">Peter Dinklage</div>
<div class="cell">Tyrion Lannister</div>
<div class="cell">June 11, 1969</div>
<div class="cell">Gemini</div>
<div class="cell">2-3-4-6-11</div>
</div>
<div style="padding-top:1px;display: table-row;">
<div class="cell">146</div>
<div class="cell">Game Of Thrones</div>
<div class="cell">HBO</div>
<div class="cell">USA</div>
<div class="cell">English</div>
<div class="cell">Kit Harington</div>
<div class="cell">Jon Snow</div>
<div class="cell">December 26, 1986</div>
<div class="cell">Capricorn</div>
<div class="cell">1-2-3-6-9</div>
</div>
</div>
CSS:
html,body {width:100%;height:95vh;background-color: rgba(31,30,30,1); overflow:hidden;}
.records {width:99%; overflow-x:hidden; overflow-y:auto; display: table}
.header-cell {background:#3a3a3a;color:#ffffff;display:table-cell;border:1px solid #fff;}
.cell {background:#cccccc;color:#494949;display:table-cell;border:1px solid #fff;}
.header {display: table-row;}
.row1 {padding-top:4px;}
/* scrollbars */
::-webkit-scrollbar {width: 5px;}
::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); -webkit-border-radius: 10px; border-radius: 10px;}
::-webkit-scrollbar-thumb {-webkit-border-radius: 10px; border-radius: 10px; background: rgba(204,51,0,0.9); -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
::-webkit-scrollbar-thumb:window-inactive { background: rgba(255,0,0,0.4); }
/* scrollbars */
::-webkit-scrollbar {width: 5px;}
::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); -webkit-border-radius: 10px; border-radius: 10px;}
::-webkit-scrollbar-thumb {-webkit-border-radius: 10px; border-radius: 10px; background: rgba(204,51,0,0.9); -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); }
::-webkit-scrollbar-thumb:window-inactive { background: rgba(255,0,0,0.4); }

Content not displayed correctly [duplicate]

This question already has answers here:
Why is this inline-block element pushed downward?
(8 answers)
Closed 6 years ago.
EDIT: here is a link to whats going on http://flameforged.altervista.org/games/gd/
I have 4 divs inside the <main> element I have styled them to display all on the same line straight across no matter what.
When I have lets say <h3>Title</h3> in all the divs they all display correctly still but once I add a little input field <input type="text"> all the other divs appear to be moved down.
I am not sure how to fix the issue here is my css and html
body{
width: 100%;
height: 100%;
}
header{
background-color: #c0c0c0;
border-radius: 0px 0px 0px 0px;
-moz-border-radius: 0px 0px 0px 0px;
-webkit-border-radius: 0px 0px 0px 0px;
border: 1px solid #c4bac4;
}
.nav-bar{
display: inline;
float: right;
}
.panel{
display: inline-block;
border-radius: 0px 0px 0px 0px;
-moz-border-radius: 0px 0px 0px 0px;
-webkit-border-radius: 0px 0px 0px 0px;
border: 1px solid #c4bac4;
width: 24%;
height: 100%;
padding: 2px;
margin-left: 0%;
}
<main>
<div class="panel" id="researchPanel">
<h3>Research</h3>
</div>
<div class="panel" id="typerPanel">
<h3>HTML Terminal</h3>
<form>
<input type="text" class="typer" id="typer" placeholder="Type an HTML tag">
</form>
</div>
<div class="panel" id="employeePanel">
<h3>Employees</h3>
</div>
<div class="panel" id="upgradesPanel">
<h3>Upgrades</h3>
</div>
</main>
Give vertical-align: top to panel. here is your working answer
body{
width: 100%;
height: 100%;
}
header{
background-color: #c0c0c0;
border-radius: 0px 0px 0px 0px;
-moz-border-radius: 0px 0px 0px 0px;
-webkit-border-radius: 0px 0px 0px 0px;
border: 1px solid #c4bac4;
}
.nav-bar{
display: inline;
float: right;
}
.panel{
display: inline-block;
border-radius: 0px 0px 0px 0px;
-moz-border-radius: 0px 0px 0px 0px;
-webkit-border-radius: 0px 0px 0px 0px;
border: 1px solid #c4bac4;
width: 24%;
height: 100%;
padding: 2px;
margin-left: 0%;
vertical-align: top;
}
<main>
<div class="panel" id="researchPanel">
<h3>Research</h3>
</div>
<div class="panel" id="typerPanel">
<h3>HTML Terminal</h3>
<form>
<input type="text" class="typer" id="typer" placeholder="Type an HTML tag">
</form>
</div>
<div class="panel" id="employeePanel">
<h3>Employees</h3>
</div>
<div class="panel" id="upgradesPanel">
<h3>Upgrades</h3>
</div>
</main>

Why do I get wrong alignment in this if I use bootstrap?

If I use bootstrap, it messes the alignment up on my page. Member names should be appeared right next to icon, but with Bootstrap, they overlap the icon.
How can I fix this?
Also, when the browser window is made smaller, the square line gets messed up too. I want the data to have a border when the window is small.
So I don't want it to look like this:
But rather, like this:
If possible I want to have these icon, and name in middle not on the top.
DEMO http://jsfiddle.net/sbq7X/
HTML
<div class="store_row">
<div class="store_left">
<div class="store_title">walmart</div>
<div class="store_location">Located in California</div>
</div>
<div class="store_right">
<div class="store_icon">
<img class="img-polaroid" src="http://www.miraiha.net/wpblog/wp-content/uploads/2010/10/designreviver-free-twitter-social-icon-300x266.jpg" />
</div>
<div class="introduction">
<div class="name1">John Tailor</div>
<div class="name2">Mike Smith</div>
<div class="name3">Jessica Swan</div>
</div>
</div>
</div>
<div class="store_row">
<div class="store_left">
<div class="store_title">walmart</div>
<div class="store_location"><span class='text-error'>Located in California</span></div>
</div>
<div class="store_right">
<div class="store_icon">
<img class="img-polaroid" src="http://media-cache-ec1.pinterest.com/avatars/walmarthub-1349815045_600.jpg" />
</div>
<div class="introduction">
<div class="name1">John Tailor</div>
<div class="name2">Mike Smith</div>
<div class="name3">Jessica Swan</div>
</div>
</div>
CSS
div.store_row{
min-width: 300px;
margin-bottom: 20px;
margin-left: 10px;
margin-right: 10px;
border:1px solid;
display:table;
}
div.store_left{
width: 300px;
display:inline-block;
vertical-align:top;
}
div.store_right{
width: 300px;
display:inline-block;
vertical-align:top;
background-color: #FFFFFF;
}
div.store_title{
background-color: #000000;
color: #FFFFFF;
height: 35px;
padding:5px;
}
div.store_location{
height: 35px;
border-right:1px solid;
background-color: #FFFFFF;
padding:5px;
}
div.store_icon{
width: 70px;
height: 70px;
display:inline-block;
}
div.store_icon img{
width:100%;
height:100%;
}
div.introduction{
display:inline-block;
vertical-align:top;
width:200px;
text-align: left;
}
.... and bootstrap
img-polaroid class has 4px padding and it causes the problem:
.img-polaroid {
padding: 4px;
background-color: #fff;
border: 1px solid #ccc;
border: 1px solid rgba(0, 0, 0, 0.2);
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
See the fiddle where it's removed.
EDIT: The alignment is working fine as well. You have static width for the all elements and they're too wide for fiddle. I've decreased their size so they are inline now.

Different links that use the same link text may be confusing: See matching tag(s)?

I am using html5 and css3 in my site project.
My css
.featured-posts{
display: block;
overflow: hidden;
margin-left: -10px;
margin-bottom: 0px;
width: 960px;
}
.featured-posts li{
display: block;
float: left;
position: relative;
width: 300px;
margin: 10px;
}
.featured-posts li .thumb{
display: block;
width: 300px;
margin-bottom: 0px;
line-height: 0em;
background: #f1f1f1 url(../img/plus.png) no-repeat center center ;
-webkit-box-shadow: 0px 0px 2px rgba(0,0,0,.3);
-moz-box-shadow: 0px 0px 2px rgba(0,0,0,.3);
box-shadow: 0px 0px 2px rgba(0,0,0,.3);
}
.featured-posts li .thumb img{
margin: 5px;
}
.featured-posts li .thumb span:hover img{
opacity: 0.4;
}
.featured-posts .link-button{
opacity: 0;
}
.featured-posts li:hover .link-button{
opacity: 1;
}
.featured-posts li .link-button:hover{
background: #f1f1f1;
padding: 2px 8px;
-webkit-box-shadow: 0px 2px 0px rgba(56, 7, 7, 1);
-moz-box-shadow: 0px 2px 0px rgba(56, 7, 7, 1);
box-shadow: 0px 1px 0px rgba(0, 0, 0, .2);
}
.featured-posts .excerpt-arrow{
position: absolute;
top: -10px;
left: 20px;
background: url(../img/excerpt-arrow.png) no-repeat top left;
}
.featured-posts .excerpt{
position: relative;
padding: 15px 15px 0px 15px;
margin-bottom: 0px;
}
.featured-posts .excerpt .heading {
font-weight: bold;
font-size: 14px;
border-bottom: 1px solid #ccc;
padding-bottom: 5px;
margin-bottom: 5px;
}
#content-wrap .featured-posts .excerpt .heading a{
text-decoration: none;
color: #606060;
}
#content-wrap .featured-posts .excerpt .heading a:hover{
color: #000000;
}
my html code-
<ul class="featured-posts">
<li>
<img src="img/Web.png" alt="Post" />
<div class="excerpt">
<div class="heading">Web Design</div>
<p>MCS PMS is a comprehensive Front Desk Reservation/Check-In solution package that is EPABX compliant and integrates well advance with other M Cubic modules like POS & Housekeeping Department.</p><br />
<br />
Read More,..
</div>
</li>
<li>
<img src="img/Logo.png" alt="Post" />
<div class="excerpt">
<div class="heading">Logo Design</div>
<p>We provide unbelievable, unique logo-design to brand your representation and identity. We offer several designs.</p><br />
<br /><br /><br />
Read More,..
</div>
</li>
<li>
<img src="img/Broucher.png" alt="Post" />
<div class="excerpt">
<div class="heading">Brochure Design</div>
<p>We are ready to produce a fantastic piece of printing design, which really reflects the goals and promotional aims of your business.</p><br />
<br /><br />
Read More,..
</div>
</li>
</ul>
<div class="clear"></div>
Different links that use the same link text may be confusing: See
matching tag(s)
on line(s
this Error comes on each read more anchor tag while testing total Validator tool.
what is the mistake in
Read More,..
I dont think you've made a mistake. Your code looks correct.
The validator you are using is most likely reporting a "warning" because for accessability reasons the link text being the same could cause confusion to some users.
If you are really concerned with these errors try using
Read More about logo designing..
instead of
Read More,..
This will make your button design a challenge but will stop the warnings.
OR
Understand that is is a warning - not an arror.