?
Solved

Divs alignment and CSS

Posted on 2013-11-06
4
Medium Priority
?
305 Views
Last Modified: 2013-11-06
Hi  

Apologies this is probably very simple :/

There is a main page on my site, as I post new articles I list them on the main page. each listing is in its own div controlled by a class defined in css.
.HomeArticle {
	text-align:left;
	height:71px
}

Open in new window

My problem is, I would like to put some spacing after each one because sometimes they sit to close together like so;
Spacing in chromeSpacing in FirefoxSpacing in IE
I have tried adding both padding and margin to the HomeArticle class, both result in the following,

Spacing Broken
I'm making a schoolboy stupid error, but I don't know what it is :( Can someone point me on the right direction?

Pete
0
Comment
Question by:Pete Long
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 57

Author Comment

by:Pete Long
ID: 39627139
link so you can see what I mean

PL
0
 
LVL 53

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 200 total points
ID: 39627189
See line 122 in  your css and add margin-bottom

.HomeArticle {
text-align: left;
height: 71px;
margin-bottom: 30px;
}

Open in new window

0
 
LVL 43

Accepted Solution

by:
Chris Stanyon earned 1800 total points
ID: 39627198
Couple of issues here. You are floating the content of the DIV so it effectively collapses. You can stop this by adding overflow:hidden to the DIV and then adding your margin. You then get a problem of the text disappearing if it's deeper than the 71px. Remove that and let the DIV expand to fit the content:

.HomeArticle {
    margin-bottom: 20px;
    overflow: hidden;
    text-align: left;
}

Open in new window

0
 
LVL 57

Author Comment

by:Pete Long
ID: 39627295
padas - That had the same effect.

ChrisStanyon - Spot on that's what I needed ThanQ!, I dropped the margin to 5px but that's exactly what I needed :)

Regards,

Pete
0

Featured Post

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question