Solved

Divs alignment and CSS

Posted on 2013-11-06
4
291 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
  • 2
4 Comments
 
LVL 57

Author Comment

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

PL
0
 
LVL 52

Assisted Solution

by:Scott Fell, EE MVE
Scott Fell,  EE MVE earned 50 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 450 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add animation to your css 12 32
How to open a zip file 4 61
CSS z-index issue 3 20
bootstrap footer centering and columns alignement 3 20
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Read about why website design really matters in today's demanding market.
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at google.com/fonts: Browse or search based on font properties or name to find a suitable font for…
The viewer will learn how to dynamically set the form action using jQuery.

911 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

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now