Solved

Divs alignment and CSS

Posted on 2013-11-06
4
298 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
The viewer will learn how to count occurrences of each item in an array.
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.

738 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