CSS Float Left Inconsistencies Elements Randomly Jump Row - html

I've been trying to write custom CSS for styling of related posts which appear under each article of my website. Each related post consists of 1 thumbnail and 1 text headline.
There are 8 in total under each page grouped in a UL list, and the LI elements are floated to the Left so they display in 2 rows.
Problem is for some reason occasionally I have LI items which jump row for now apparent reason.
Here is an example:
Screenshot
This is the html part of the code:
<div class="crp_related ">
<h3>Related Stories:</h3>
<ul>
<li style="padding-top: 10px">
<a href="./document-reveals-isis-plot-for-world-domination-in-chilling-detail-full-translation-below/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="Document reveals ISIS plot for world domination in chilling detail: Full translation below" alt="Document reveals ISIS plot for world domination in chilling detail: Full translation below"
src="./wp-content/uploads/2015/12/Screen-Shot-2015-12-07-at-12.45.19-PM-150x150.png">
</a>
<br>
<a class="crp_title" href="./document-reveals-isis-plot-for-world-domination-in-chilling-detail-full-translation-below/">Document reveals ISIS plot for world domination in chilling…</a>
</li>
<li style="padding-top: 10px">
<a href="./devout-us-muslim-and-his-saudi-wife-left-their-baby-at-home-to-storm-back-to-office-christmas-party-with-automatic-weapons-and-slaughter-14-of-his-colleagues-before-dying-in-police-shoot-out/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="‘Devout’ US Muslim and his Saudi wife left their baby at home to storm back to office Christmas party with automatic weapons and slaughter 14 of his colleagues before dying in police shoot-out"
alt="‘Devout’ US Muslim and his Saudi wife left their baby at home to storm back to office Christmas party with automatic weapons and slaughter 14 of his colleagues before dying in police shoot-out" src="./wp-content/uploads/2015/12/farook1-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./devout-us-muslim-and-his-saudi-wife-left-their-baby-at-home-to-storm-back-to-office-christmas-party-with-automatic-weapons-and-slaughter-14-of-his-colleagues-before-dying-in-police-shoot-out/">‘Devout’ US Muslim and his Saudi wife left their</a>
</li>
<li style="padding-top: 10px">
<a href="./obama-we-lose-when-america-scrutinizes-muslims-betrayal-of-our-values/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="Obama: ‘We Lose’ When America Scrutinizes Muslims… ‘Betrayal of Our Values’" alt="Obama: ‘We Lose’ When America Scrutinizes Muslims… ‘Betrayal of Our Values’"
src="./wp-content/uploads/2015/12/Obama126-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./obama-we-lose-when-america-scrutinizes-muslims-betrayal-of-our-values/">Obama: ‘We Lose’ When America Scrutinizes…</a>
</li>
<li style="padding-top: 10px">
<a href="./great-partners-pentagon-rejects-russian-evidence-of-turkey-aiding-isis/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="‘Great partners’: Pentagon rejects Russian evidence of Turkey aiding ISIS" alt="‘Great partners’: Pentagon rejects Russian evidence of Turkey aiding ISIS"
src="./wp-content/uploads/2015/12/565f3967c461884a3d8b4627-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./great-partners-pentagon-rejects-russian-evidence-of-turkey-aiding-isis/">‘Great partners’: Pentagon rejects Russian…</a>
</li>
<li style="padding-top: 10px">
<a href="./7-isis-facts-every-american-must-know/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="7 ISIS Facts Every American Must Know" alt="7 ISIS Facts Every American Must Know" src="./wp-content/uploads/2015/12/ISIS-Genocide-in-Iraq-AP-Photo-640x480.jpg">
</a>
<br>
<a class="crp_title" href="./7-isis-facts-every-american-must-know/">7 ISIS Facts Every American Must Know</a>
</li>
<li style="padding-top: 10px">
<a href="./will-your-city-or-state-be-the-next-san-bernardino-at-least-22-verified-islamic-terror-training-camps-in-us-all-under-the-watchful-eye-of-the-fbi/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="Will Your City or State be the Next San Bernardino? At Least 22 Verified Islamic Terror Training Camps in US – All Under the Watchful Eye of the FBI"
alt="Will Your City or State be the Next San Bernardino? At Least 22 Verified Islamic Terror Training Camps in US – All Under the Watchful Eye of the FBI" src="./wp-content/uploads/2015/12/120515_2259_WillYourCit1-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./will-your-city-or-state-be-the-next-san-bernardino-at-least-22-verified-islamic-terror-training-camps-in-us-all-under-the-watchful-eye-of-the-fbi/">Will Your City or State be the Next San Bernardino? At Least</a>
</li>
<li style="padding-top: 10px">
<a href="./allah-took-their-sanity-putin-accuses-turkish-leadership-of-aiding-terror/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="‘Allah took their sanity’: Putin accuses Turkish leadership of ‘aiding terror’" alt="‘Allah took their sanity’: Putin accuses Turkish leadership of ‘aiding terror’"
src="./wp-content/uploads/2015/12/56600a0dc46188c3078b45e7-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./allah-took-their-sanity-putin-accuses-turkish-leadership-of-aiding-terror/">‘Allah took their sanity’: Putin accuses Turkish…</a>
</li>
<li style="padding-top: 10px">
<a href="./russian-warplanes-hit-1458-terrorist-targets-in-syria-over-past-week/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="Russian Warplanes Hit 1,458 Terrorist Targets in Syria Over Past Week" alt="Russian Warplanes Hit 1,458 Terrorist Targets in Syria Over Past Week"
src="./wp-content/uploads/2015/12/1028392998-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./russian-warplanes-hit-1458-terrorist-targets-in-syria-over-past-week/">Russian Warplanes Hit 1,458 Terrorist Targets in Syria Over…</a>
</li>
</ul>
<div class="crp_clear">
</div>
</div>
And this is the CSS part:
div.crp_related {
clear: both;
margin: 10px 0;
}
div.crp_related h3 {
margin: 0 !important;
}
div.crp_related ul {
list-style: none;
float: left;
margin: 0 !important;
padding: 0 !important;
}
div.crp_related li, div.crp_related a {
float: left;
overflow: hidden;
position: relative;
text-align: left;
display: table-cell;
}
div.crp_related li {
margin: 5px !important;
padding: 6px;
}
div.crp_related li:hover {
background: #eee;
}
div.crp_related a:hover {
text-decoration: none;
}
div.crp_related img {
max-width: 150px;
max-height: 150px;
min-height: 150px;
min-width: 150px;
margin: auto;
display: block;
overflow: hidden;
}
div.crp_related .crp_title {
position: relative;
max-width: 150px;
height: 100%;
padding-left: 0px;
padding-right: 3px;
padding-top: 3px;
padding-bottom: 3px;
color: #dc291e;
font-size: 12pt;
font-weight: bold;
}
div.crp_related .crp_thumb, div.crp_related li, div.crp_related .crp_title {
vertical-align: bottom;
}
.crp_clear {
clear: both;
}
Why is this happening?
What am I doing wrong?

Add following div after every four records.
<div style='clear:both'></div>

Please post a snippet of code with both CSS and HTML together.
1)
Probably the problem is due to the fact that in the first row the first 2 articles have a longer crp_title and it spans 4 rows, but in the other 2 articles crp_title spans 3 rows.
A floating element going in a new line tries to go up, and the reason why the second articles' row goes right is that the 3rd and 4th articles of the first row have a smaller height.
You can easily check it with your browser inspector.
2)clear:both after the last element of each row
A quick fix can be setting a fixed height in px of your .crp_title

This should do the trick:
div.crp_related > ul > li:nth-child(4):after {
content: '';
clear: both;
display: block;
visibility: hidden;
height: 0px;
}

This issue is due to unequal height of floated content, so you need to clear float and get next element on new row. You can do that using nth-child selectors.
div.crp_related {
clear: both;
margin: 10px 0;
}
div.crp_related h3 {
margin: 0 !important;
}
div.crp_related ul {
list-style: none;
float: left;
margin: 0 !important;
padding: 0 !important;
}
div.crp_related li,
div.crp_related a {
float: left;
overflow: hidden;
position: relative;
text-align: left;
display: table-cell;
}
div.crp_related li {
margin: 5px !important;
padding: 6px;
}
div.crp_related li:hover {
background: #eee;
}
div.crp_related a:hover {
text-decoration: none;
}
div.crp_related img {
max-width: 150px;
max-height: 150px;
min-height: 150px;
min-width: 150px;
margin: auto;
display: block;
overflow: hidden;
}
div.crp_related .crp_title {
position: relative;
max-width: 150px;
height: 100%;
padding-left: 0px;
padding-right: 3px;
padding-top: 3px;
padding-bottom: 3px;
color: #dc291e;
font-size: 12pt;
font-weight: bold;
}
div.crp_related .crp_thumb,
div.crp_related li,
div.crp_related .crp_title {
vertical-align: bottom;
}
.crp_clear {
clear: both;
}
/* THIS IS DUE TO UNEQUAL HEIGHT OF FLOATED CONTENT, so Clear Float on every 5th element */
#media (min-width: 768px) {
div.crp_related li:nth-child(4n+1) {
clear: both;
}
}
#media (max-width: 767px) {
div.crp_related li:nth-child(3n+1) {
clear: both;
}
<div class="crp_related ">
<h3>Related Stories:</h3>
<ul>
<li style="padding-top: 10px">
<a href="./document-reveals-isis-plot-for-world-domination-in-chilling-detail-full-translation-below/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="Document reveals ISIS plot for world domination in chilling detail: Full translation below" alt="Document reveals ISIS plot for world domination in chilling detail: Full translation below"
src="./wp-content/uploads/2015/12/Screen-Shot-2015-12-07-at-12.45.19-PM-150x150.png">
</a>
<br>
<a class="crp_title" href="./document-reveals-isis-plot-for-world-domination-in-chilling-detail-full-translation-below/">Document reveals ISIS plot for world domination in chilling…</a>
</li>
<li style="padding-top: 10px">
<a href="./devout-us-muslim-and-his-saudi-wife-left-their-baby-at-home-to-storm-back-to-office-christmas-party-with-automatic-weapons-and-slaughter-14-of-his-colleagues-before-dying-in-police-shoot-out/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="‘Devout’ US Muslim and his Saudi wife left their baby at home to storm back to office Christmas party with automatic weapons and slaughter 14 of his colleagues before dying in police shoot-out"
alt="‘Devout’ US Muslim and his Saudi wife left their baby at home to storm back to office Christmas party with automatic weapons and slaughter 14 of his colleagues before dying in police shoot-out" src="./wp-content/uploads/2015/12/farook1-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./devout-us-muslim-and-his-saudi-wife-left-their-baby-at-home-to-storm-back-to-office-christmas-party-with-automatic-weapons-and-slaughter-14-of-his-colleagues-before-dying-in-police-shoot-out/">‘Devout’ US Muslim and his Saudi wife left their</a>
</li>
<li style="padding-top: 10px">
<a href="./obama-we-lose-when-america-scrutinizes-muslims-betrayal-of-our-values/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="Obama: ‘We Lose’ When America Scrutinizes Muslims… ‘Betrayal of Our Values’" alt="Obama: ‘We Lose’ When America Scrutinizes Muslims… ‘Betrayal of Our Values’"
src="./wp-content/uploads/2015/12/Obama126-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./obama-we-lose-when-america-scrutinizes-muslims-betrayal-of-our-values/">Obama: ‘We Lose’ When America Scrutinizes…</a>
</li>
<li style="padding-top: 10px">
<a href="./great-partners-pentagon-rejects-russian-evidence-of-turkey-aiding-isis/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="‘Great partners’: Pentagon rejects Russian evidence of Turkey aiding ISIS" alt="‘Great partners’: Pentagon rejects Russian evidence of Turkey aiding ISIS"
src="./wp-content/uploads/2015/12/565f3967c461884a3d8b4627-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./great-partners-pentagon-rejects-russian-evidence-of-turkey-aiding-isis/">‘Great partners’: Pentagon rejects Russian…</a>
</li>
<li style="padding-top: 10px">
<a href="./7-isis-facts-every-american-must-know/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="7 ISIS Facts Every American Must Know" alt="7 ISIS Facts Every American Must Know" src="./wp-content/uploads/2015/12/ISIS-Genocide-in-Iraq-AP-Photo-640x480.jpg">
</a>
<br>
<a class="crp_title" href="./7-isis-facts-every-american-must-know/">7 ISIS Facts Every American Must Know</a>
</li>
<li style="padding-top: 10px">
<a href="./will-your-city-or-state-be-the-next-san-bernardino-at-least-22-verified-islamic-terror-training-camps-in-us-all-under-the-watchful-eye-of-the-fbi/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="Will Your City or State be the Next San Bernardino? At Least 22 Verified Islamic Terror Training Camps in US – All Under the Watchful Eye of the FBI"
alt="Will Your City or State be the Next San Bernardino? At Least 22 Verified Islamic Terror Training Camps in US – All Under the Watchful Eye of the FBI" src="./wp-content/uploads/2015/12/120515_2259_WillYourCit1-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./will-your-city-or-state-be-the-next-san-bernardino-at-least-22-verified-islamic-terror-training-camps-in-us-all-under-the-watchful-eye-of-the-fbi/">Will Your City or State be the Next San Bernardino? At Least</a>
</li>
<li style="padding-top: 10px">
<a href="./allah-took-their-sanity-putin-accuses-turkish-leadership-of-aiding-terror/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="‘Allah took their sanity’: Putin accuses Turkish leadership of ‘aiding terror’" alt="‘Allah took their sanity’: Putin accuses Turkish leadership of ‘aiding terror’"
src="./wp-content/uploads/2015/12/56600a0dc46188c3078b45e7-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./allah-took-their-sanity-putin-accuses-turkish-leadership-of-aiding-terror/">‘Allah took their sanity’: Putin accuses Turkish…</a>
</li>
<li style="padding-top: 10px">
<a href="./russian-warplanes-hit-1458-terrorist-targets-in-syria-over-past-week/">
<img width="150" height="150" onerror="this.onerror=null;this.src='./no-thumbnail.jpg';" class="crp_thumb crp_correctfirst" title="Russian Warplanes Hit 1,458 Terrorist Targets in Syria Over Past Week" alt="Russian Warplanes Hit 1,458 Terrorist Targets in Syria Over Past Week"
src="./wp-content/uploads/2015/12/1028392998-150x150.jpg">
</a>
<br>
<a class="crp_title" href="./russian-warplanes-hit-1458-terrorist-targets-in-syria-over-past-week/">Russian Warplanes Hit 1,458 Terrorist Targets in Syria Over…</a>
</li>
</ul>
<div class="crp_clear">
</div>
</div>

I think the coding it's pretty much simpler. Take a look at this snippet:
ul li {
width: 200px;
height: 200px;
border: 1px solid #000;
float: left;
list-style: none;
margin-top: 40px;
margin-right: 40px;
}
ul li:last-child {
margin-right: 0;
}
<ul>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
This is the base, now you can add the image and description. This ul will fit to container's width.
Hope it helps

Related

Some hyperlinks in list aren't clickable

I am new to html so please don't mind the terrible coding..
I've created a list of links on my page in wordpress, but for some reason the first few aren't clickable. They seem to be fine here, but on my page they suddenly stop working
Here's the part of my HTML having issues:
.parent {
text-align: left;
}
.parent > ul {
display: inline-block;
}
<div class="parent" style="text-align: left; margin-left:0 auto; margin-right:0 auto; position: relative; top: +0px; right: 10px;">
<ul style= "font-size: 20px;">Public Open Sessions:
<li style="font-size: 16px;"><a href="http://shopkts.com/collections/training/products/3-day-uem-public-open-session-april-11" target="_blank" !important>April 11-13, Mississauga, Canada</a></li>
<li style="font-size: 16px;">April 18-20, Atlanta, USA</li>
<li style="font-size: 16px;">April 25-27, Calgary, Canada</li>
<li style="font-size: 16px;">May 2-4, Vancouver, Canada</li>
<li style="font-size: 16px;">May 9-11, Philadelphia, USA</li>
<li style="font-size: 16px;">May 16-18, Washington, DC, USA</li>
<li = style="font-size: 16px;">May 23-25, Dallas, USA</li>
</ul>
</div>
What's strange is the the first 3 links won't work, while the next 4 do. But if I move it to another part of the page, it suddenly works. Is it due to something else on the page?
Here is the full html incase it's needed:
.parent {
text-align: left;
}
.parent > ul {
display: inline-block;
}
<p style="text-align: center; font-size: 40px; color: black"> BlackBerry Open Sessions</p>
<p style="text-align: left;"><img class="alignnone size-full wp-image-1950" src="http://www.ktsglobal.ca/wp-content/uploads/2016/06/ps-1-e1478718264230.png" alt="ps" width="1766" height="569" /></p>
<p style="text-align: left; line-height:2px">Our public open sessions consists of instructor-led training and hands-on virtual labs. Participants will learn to Plan, Deploy and Manage BlackBerry UEM or BES12</p>
<p style="text-align: left; line-height:2px">with one of our certified instructors. Make sure to check back regularily to see our updated list of events.</p>
<hr />
<p style="text-align: center; font-size: 24px;"><img class="wp-image-1922 alignleft" src="http://www.ktsglobal.ca/wp-content/uploads/2016/11/shutterstock_196196186-e1478532776565.jpg" alt="shutterstock_196196186" width="505" height="346" /> Upcoming Public / Virtual Events:</p>
<p style="text-align: center; font-size: 18px;"></p>
<div class="parent" style="text-align: left; margin-left:0 auto; margin-right:0 auto; position: relative; top: +0px; right: 10px;">
<ul style= "font-size: 20px;">Public Open Sessions:
<li style="font-size: 16px;"><a href="http://shopkts.com/collections/training/products/3-day-uem-public-open-session-april-11" target="_blank" !important>April 11-13, Mississauga, Canada</a></li>
<li style="font-size: 16px;">April 18-20, Atlanta, USA</li>
<li style="font-size: 16px;">April 25-27, Calgary, Canada</li>
<li style="font-size: 16px;">May 2-4, Vancouver, Canada</li>
<li style="font-size: 16px;">May 9-11, Philadelphia, USA</li>
<li style="font-size: 16px;">May 16-18, Washington, DC, USA</li>
<li = style="font-size: 16px;">May 23-25, Dallas, USA</li>
</ul>
</div>
<div class="parent" style="margin-left:0 auto; margin-right:0 auto;position: relative; top: -238px; right: -380px;">
<ul style= "font-size: 20px;">Virtual Sessions:
<li style="font-size: 16px;">March 29-31</li>
<li style="font-size: 16px;">April 12-14</li>
<li style="font-size: 16px;">April 26-28</li>
</ul>
</div>
<p style="text-align: right; font-size: 20px; position: relative; top: +0px; right: 10px;">Click the training session you'd like to join to see more and sign up.<p/>
<hr style="position: relative; top: -30px;"/>
<img class="wp-image-1949 alignright" src="http://www.ktsglobal.ca/wp-content/uploads/2016/06/las-vegas-signs-clouds-blue-sky-1920x1080-e1478718166731.jpg" alt="las-vegas-signs-clouds-blue-sky-1920x1080" width="486" height="392" />
<p style="text-align: center; font-size: 24px;">Coming Soon</p>
<p style="font-size: 18px;">We are planning a special 3-day BlackBerry UEM training event in Las Vegas.</p>
<p style="font-size: 18px;">The training will focus on some new and exciting features of BlackBerry UEM.</p>
<p style="font-size: 18px;">Feel free to contact our team for more information. We hope to see you there!</p>
<hr style="position: relative; top: 20px; width:100%;"/>
<p style="text-align: center;font-size: 20px"><strong><span style="color: #0020c2;">Contact us for more info</span></strong></h4></p>
It looks like a mess but trust me, it works on the page.
Here's a link to the page
Any help would be great, thank you in advance!
Think I found it.
Try this:
.parent {
overflow: auto;
}
Your second "parent" div is covering up your links. Your code is actually really basic, so this probably isn't the best way to solve it, but it will work for you at this point.
I tried it and it worked fine, even in your webpaged link above. I don't see any problem. However, I found a typo (?) in the last <li>
<li = style="font-size: 16px;">
It should be:
<li style="font-size: 16px;">

How do I get rid of the padding in p element

How do I get rid of the white bottom padding in the P element that I have labelled the pic with in this code pen with?
I have tried making the padding 0 in it and everything round it but that hasn't worked
Thanks
body {
margin: 60px 60px 60px 60px;
font-size: 100%;
}
h1 {
font-family: lobster, Monospace;
text-align: center;
font-size: 5em;
/* 80px/16=5em */
text-decoration: underline;
margin-bottom: 60px;
border-style: ;
}
blockquote {
font-size: 20px;
font-family: 'Puritan', cursive;
color: black;
}
.img-r {
/* other definitions */
width: 100%;
}
.padding {
padding-top: 0px;
padding-bottom: 0px;
}
li {
font-family: Monospace;
text-align: center;
font-size: 2em;
/* 80px/16=5em */
text-decoration: ;
margin-bottom: 50px;
border-style: ;
word-wrap: break-word;
}
#media (max-width: 700px) {
.jumbotron p {
font-size: 5px;
}
}
.pad {
padding: 0px;
}
<head>
<link href='https://fonts.googleapis.com/css?family=Lobster' rel='stylesheet' type='text/css'>
</head>
<h1>
Dame Stephanie "Steve" Shirley
</h1>
<div class="container-fluid">
<div class="jumbotron">
<div class="row">
<div class="col-xs-12">
<div class="row">
<div class="col-xs-9 col-md-6">
<h2 style="color: #645340; text-decoration: underline;" class="text-
center">AboutDame Stephanie "Steve" Shirley </h2>
<ul class="text-center pad">
<li class="text-center"><em>Dame Stephanie "Steve" Shirley
was born as Vera Buchthal to a Jewish father, a judge in Dortmund who lost his post to the Nazi regime, and a non-Jewish Viennese mother.</em>
</li>
<li class="text-center"><em>In July 1939, at the age of five, Shirley arrived, together with her nine-year-old sister Renate, to Britain as a Kindertransport child refugee.She was placed in the care of foster parents living in the Midlands town of Sutton Coldfield.</em>
</li>
<li class="text-center"><em>After leaving school Vera decided not to go to university (botany was the "only science then available to my gender") but sought employment in a mathematics/technical environment. At the age of 18, she became a British citizen and changed her name to Stephanie Brook.</em>
</li>
<li class="text-center"><em>After leaving school Vera decided not to go to university (botany was the "only science then available to my gender") but sought employment in a mathematics/technical environment. At the age of 18, she became a British citizen and changed her name to Stephanie Brook.</em>
</li>
<li class="text-center"><em>In the 1950s, Stephanie worked at the Post Office Research Station at Dollis Hill, building computers from scratch and writing code in machine language. She took evening classes for six years to obtain an honours degree in mathematics. In 1959, she moved to CDL Ltd, designers of the ICT 1301 computer.</em>
</li>
<li class="text-center"><em>After marriage to a physicist, Derek Shirley, in 1962, Shirley founded, with a capital of £6, the software company Freelance Programmers</em>
</li>
<li class="text-center"><em> She wanted to create job opportunities for women with dependents, and predominantly employed women, with only 3 male programmers in the first 300 staff,[8] until the Sex Discrimination Act 1975 made that practice illegal.</em>
</li>
<li class="text-center"><em>She adopted the name, Steve, to help her in the male-dominated business world.[9] Her team's projects included programming Concorde's black box flight recorder.</em>
</li>
<li class="text-center"><em>Shirley retired in 1993 at the age of 60 and has since focused on her philanthropy.</em>
</li>
<li class="text-center"><em>Shirley was appointed Officer of the Order of the British Empire (OBE) in the 1980 Queen's Birthday Honours, for services to industry and promoted Dame Commander (DBE) in the New Year Honours, 2000 for services to Information Technology.</em>
</li>
</div>
<div class="col-xs-3 col-md-6">
<div class="thumbnail padding">
<img class="img-responsive img-r center-block padding" src="https://ichef.bbci.co.uk/images/ic/480xn/p014nf75.jpg">
<div>
<p class="text-center">
Dame Stephanie "Steve" Shirley
</p>
</div>
</div>
</div>
</div>
</div>
</div>
This is due to a browser specific rule. Not sure about others, but to get rid of it in Chrome, use:
-webkit-margin-after: 0px;
I'm assuming the rest follow the same vendor prefix pattern, but I haven't tested.
I added this to my css and applied the class to the p element.
It gets rid if the spacing below the p element. But the p element displays bunched up when the window is made smaller, which it didn't do before.
How do I fix that?
.margin {
padding-top: 18px;
line-height: 0;
}
Thanks,
R
Don't have the reputation to comment..
If your intent is just to have the text centered in the p, all these hacky rules aren't needed..Just set a proper line-height and pad however you want;
.jumbotron p {
font-size: 21px;
font-weight: 200;
padding: 0px; /* adjust freely */
margin: 0px;
line-height: 1em;
}
You could just go with only line-height as well, it will stay vertically centered..

make a page responsive by adding text under the image when browser is resized

I am trying to make this page responsive. As you can see when I resize the browser the text is scrunched rather than moving to the bottom of the image. Any help would be greatly appreciated!
Here is my HTML:
<div id="content-wrapper">
<div class="container">
<div class="content">
<div class="line">
<h2 class="text-center exec-header">Executive
Directors</h2>
</div>
<article class="ninecol">
<div class="content-item first cf" id="maja">
<figure>
<img alt="" class="bio-pics" src=
"/wp-content/themes/creativeforces/images/majapic.jpg"
width="250px">
</figure>
<h3 class="name">Maja Miletich</h3>
<h5 class="job-title">CEO</h5>
<div class="description">
<p>Maja Miletich is the CEO of Zip Zap Zop Kids,
LLC. Maja has worked with children on many levels.
Having a brother with Autism has given Maja an
understanding of how powerful communication is for
ALL children. Maja has worked for years as a
teacher where she practices emergent
curriculum.</p>
<p>Maja has studied theater and improv at A.C.T. in
San Francisco as well as graduated from The Second
City Training Center in Hollywood where she studied
improv and sketch comedy.</p>
<p>Maja has her Bachelors Degree in Early Childhood
Education. Maja's focus is on inclusive classrooms
where curriculum is designed to allow children and
young adults to feel comfortable expressing
themselves in whichever way they feel most
comfortable</p>
<p>Maja believes when we can share with one another
what has been taught then, and only then, are we
actually learning.</p>
</div>
</div>
<hr>
<div class="content-item first cf" id="april">
<figure>
<img alt="" class="bio-pics" src=
"/wp-content/themes/creativeforces/images/april2.jpg"
width="250px">
</figure>
<h3 class="name">April Miletich</h3>
<h5 class="job-title">CFO</h5>
<div class="description">
<p>April Rasmussen, PhD has been a credentialed
English teacher since 2008 and has taught
everything from advanced placement English language
and composition to literature through film, and
English as a second language support classes. Her
passion is for the art of story and also
storytelling as a tool for student growth. She
holds advanced degrees in education, mythology and
depth-psychology.</p>
</div>
</div>
</article>
</div>
<div class="line">
<h3 class="text-center exec-header">Board of Directors</h3>
</div>
<div class="content-item first cf" id="ari">
<figure>
<img alt="" class="bio-pics" src=
"/wp-content/themes/creativeforces/images/ari.jpg" width=
"250px">
</figure>
<h3 class="name">Ari Schenider</h3>
<h5 class="job-title">President</h5>
<div class="description">
<p>Ari Schneider is a graduate of The Second City
Conservatory and has a (BA) Hons from The Guildford School
of Acting in England. He has been a cast member of the
all-ages improv review The Really Awesome Improv Show
(Voted Best Kid’s Comedy Show) at The Second City in
Hollywood for the past 3 years. He also is affiliated with
the mentorship program, YSF (The Young Screenwriters
Foundation) at New Rhodes as well as teaching afer-school
improv with Zip Zap Zop Kids, LLC.</p>
</div>
</div>
<hr>
<div class="content-item first cf" id="debra">
<figure>
<img alt="" class="bio-pics" src=
"/wp-content/themes/creativeforces/images/debra.jpg" width=
"250px">
</figure>
<h3 class="name">Debra Gliozzi</h3>
<h5 class="job-title">Treasurer</h5>
<div class="description">
<p>Debra Kratochvil Gliozzi is a first generation American
and first in her family to attend college. Her career spans
35 years and two distinct industries. Debra is currently an
administrator and educator in Danville, California. She
brought her MBA and business experience to San Ramon Valley
High School and integrated Business Computers (an ROP
course), Personal Finance and Introduction to Business and
Entrepreneurship into the curriculum. Debra says that her
goal is to equip students with skills that prepare them for
the real world. It is the most important thing I can
do.</p>
<p>This is her second career after transitioning from the
Telecommunications Industry where she held management
positions at Calix Inc., SBC Communications, Pacific Bell,
MCI and Sprint. Her vast experiences included Forecasting,
Accounting, Business Analysis, Market Financials,
Competitive Assessment, Product Development, Product
Marketing, Procurement, Quality Management and Sales
Operations & Planning.</p>
</div>
</div>
<hr>
<div class="content-item first cf" id="debra">
<figure>
<img alt="" class="bio-pics" src=
"/wp-content/themes/creativeforces/images/melina.jpg"
width="250px">
</figure>
<h3 class="name">Melina Johnson</h3>
<h5 class="job-title">Secretary</h5>
<div class="description">
<p>Melina Johnson is a self-employed entrepreneur who
created her own home organizing business. Melina is the
mother of two children, her son having Autism. She has
spent countless hours dedicated to researching and
providing her son with the best therapies and services to
help him with his growth and development. Every therapist
and teacher, over the years, has told Melina that her
natural sense of humor has been the best therapy she could
provide to her son - Humor and laughter open up doors to
cognitive and social development. And it’s fun!</p>
<p>Melina’s education has been in the health sciences,
having a degree in Dental Hygiene. After years of hygiene
practice, she decided to create a job for herself that
would utilize her natural organizational skills, and allow
her creativity and fun. Melina continues to grow her home
organizing business and raise her children with a strong
sense of responsibility, and a positive outlook on
life.</p>
</div>
</div>
</div>
</div>
and CSS:
.line {
overflow: hidden;
text-align: center;
}
.exec-header{
margin-top: 15px;
display: inline-block;
padding: 0 15px;
position: relative;
font-family: Roboto Condensed;
font-weight: bold;
font-size: 30px;
}
.content .ninecol {
padding-right: 4.6875%;
padding-left: 4.6875%;
}
.exec-header:before{
right: 100%;
}
.exec-header:before, .exec-header:after {
background: #333333;
content: "";
display: block;
height: 3px;
position: absolute;
top: 50%;
width: 96%;
}
.content {
overflow: hidden;
margin: 0 auto;
max-width: 1200px;
}
.content-item.first {
padding-top: 0;
background: 0;
overflow:hidden;
}
.content-item {
margin-left: -2.18978%;
margin-right: -2.18978%;
padding: 30px 2.18978%;
}
#maja{
margin-top: 10px;
}
#ari{
margin-top: 10px;
}
.exec-header:after {
left: 100%;
}
.cf:before, .cf:after {
content: " ";
display: table;
}
.content-item figure {
}
figure img {
padding-bottom: 14px;
}
.bio-pics {
display: block;
max-width: 100%;
height: auto;
-ms-interpolation-mode: bicubic;
-moz-user-drag: -moz-none;
-webkit-user-drag: none;
user-drag: none;
}
h3.name {
margin-bottom: .75em;
line-height: 1.2em;
font-family: Roboto Condensed;
font-weight: bold;
}
.content-item figure {
float: left;
margin-right: 5.83942%;
margin-bottom: 0;
}
.content-item .description, .content-item .details {
overflow: hidden;
}
.content-item .description {
min-height: 0;
}
h5.job-title{
font-family: Roboto Condensed;
font-weight: bold;
margin-top: -16px;
}
try by adding float:left ; in description class in css file
it should work also add an display inline-block to div with id=maja

How to place a text next to an image?

I'm trying to place the text that's currently below the picture next to the image but I can't seem to figure it out. I tried a bunch of things but it screwed it up. I'm pretty sure this is an easy fix but I'm a noob. :D
http://jsfiddle.net/NmUaX/5/
HTML
<li class="post" >
<article class="in-column" style="height:300px;"> <p class="article-title" style="font-size:20px; padding-bottom:10px;">Grumpy Cat</p><img src="http://cdn.dashburst.com/wp-content/uploads/2013/01/Grumpy-Cat.jpg" border="0"; height="200" width="300">
<p class="excerpt" style="float:left;">Grumpy Cat, real name Tardar Sauce, is a female cat and Internet celebrity known for her grumpy facial expression. Her owner Tabatha Bundesen says that her permanently grumpy-looking face is due to feline dwarfism. <b>[READ MORE]</b></p>
<p class="excerpt">Born: April 4, 2012, Morristown, AZ</p>
</article>
</li>
</section>
</section>
CSS
article.in-column {
border-bottom: 1px solid #dddddd;
text-align: left;
padding-left: 25px;
padding-right: 25px;
padding-top: 15px;
}
article.in-column .excerpt {
color: #2f2f2f;
font-size: 11px;
margin: 0px;
padding-bottom: 5px;
}
p.article-title{
line-height: 19px;
margin: 5px 0px;
color: #151515;
font-weight:bold;
font-size:16px;
}
Use style="float:left;" on your image, not on your text.
Also, remove the stray semicolon in your img tag.
As shown here:
<img src="http://cdn.dashburst.com/wp-content/uploads/2013/01/Grumpy-Cat.jpg" border="0"; height="200" width="300">
JSFiddle
I think you need something like this:
<ul style="list-style:none; width:700px">
<li style="float:left; margin:5px;width:310px;">
<ul style="list-style:none">
<li>
<span style="font-size:20px; padding-bottom:10px;">Grumpy Cat</span>
</li>
<li>
<a href="http://yahoo.com" style="float:left;margin-right:5px">
</li>
<li style="float:left;width:380px;">
<ul style="list-style:none">
<li>
<span style="font-weight:700" >Born: April 4, 2012, Morristown, AZ</span>
</li>
<li>
Grumpy Cat, real name Tardar Sauce, is a female cat and Internet celebrity known for her grumpy facial expression. Her owner Tabatha Bundesen says that her permanently grumpy-looking face is due to feline dwarfism. <b>[READ MORE]</b>
</li>
</ul>
</li>
</ul>
see http://jsfiddle.net/NmUaX/15/

Footer text overflow on 4 columns. How do I prevent?

I have a four column footer that works fine until the browser window is shrunk.
The 2nd column(Div ID fourth) then would start push text under one of the other boxes:
It's easier to see on the website: Teetimelawn.com
I tried a few solutions but they usually end up pushing the div for fourth under near the other 3 inline div columns.
Here's the CSS info:
.footer {
background-color: #336600;
clear: both;
float: none;
padding-top: 10px;
padding-right: 0;
padding-bottom: 0px;
padding-left: 0px;
height: 350px;
color: #F7F7F7;
min-width: 1400px;
width: 100%;
max-height: 350px;
text-align: center;
display: inline-block;
}
#third {
width: 180px;
float: left;
text-align: left;
margin-left: 10px;
display: inline-block;
margin-right: 5px;
}
#first {
width: 300px;
float: right;
overflow: visible;
margin-right: 10px;
}
#second {
float: right;
margin-right: 10px;
margin-left: 10px;
}
#fourth {
height: 100%;
clear: none;
padding-left: 10px;
padding-right: 10px;
}
Here's the HTML
<div class="footer">
<div id=third>
<h1>Site Map
</h1>
<p1>
<a href="/index.html">Home page
</a> <br>
<a href="/estimate.htm">Estimate Form
</a> <br> <p1>
<a href="/lawncare.html">Lawn Care Process
</a> <br>
<p1>
<a href="/trees.html">Tree And Shrub Control
</a> <br>
<p1><a href="/pestcontrol.html">Pest Control Services
</a> <br>
<p1>Lawn Sprinkler ervice <br>
<p1><a href="/paybal.php">Secure Online Bill Pay
</a> <br>
<p1>
<a href="/careers.html">Careers And Team
</a>
<p1>
<br>
<p1>
<a href="/testimony.html">Customer Testimony And Lawn Gallery
</a>
<br>
</div>
<div id=first><div itemscope itemtype="http://www.schema.org/LocalBusiness">
<h1 itemprop="name">Tee Time Lawn Care</h1>
<br>1566 Frontage Rd
O'Fallon, IL 62269</p1></a>
<br>
<p1 itemprop="telephone">(618) 632-8873<br>(636) 272-8873</p1>
<br>
<br>
<p2 itemprop="description"> A local lawn and landscaping company with an emphasis on safe, organic lawn care. Lawn care companies like us will treat your lawn and yard like a golf course so give us a call if you need the best lawn in your neighborhood. </p2></div>
</div>
<div id=second>
<h1>Lawn care company service in Missouri, Illinois (MO, IL)<br>
St. Louis suburbs including:</h1>
Fairview Heights lawn care, Fairview Heights landscaping<br>
St. Louis lawn care, St. Louis landscaping<br>
Edwardsville lawn care, Edwardsville landscaping<br>
Granite city lawn care, Granite city landscaping<br>
Saint Charles lawn care, Saint Charles landscaping<br>
Belleville lawn care, Belleville landscaping<br>
Collinsville lawn care, Collinsville landscaping<br> O'Fallon lawn care, O'Fallon landscaping<br>
And nearby towns and cities for your yard service needs.<br><br>
</div><div id=fourth>
<h1> Our lawn care and landscaping services include:</h1>
<p2>Organic and granular fertilization, aeration and seeding, pest control, tree and shrub maintenance service, soil conditioning, heat guard, summer recovery, root rejuvenation, winterizing, blanket barrier, mole removal, yard cleaning, lawn and yard mowing, commercial landscaping, weed removal, weed prevention, vole removal, and more!
<br> Please contact us for additional services.</p2>
</div>
<!-- end .footer -->
</div>
Google+
</body>
</html>
Try change the padding in #fourth div id into margin like this:
margin-right: 20px;
margin-left: 10px;
UPDATE : I create This Fiddle for example of my latest comment.