Solved

Divs alignment and CSS

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This Micro Tutorial will demonstrate how nuggets on the Web are formatted by using Chrome Developer Tools. These tools would not only view the site's CSS but it can also modify it and save the CSS to use on your own site.
How to create a custom search shortcut to site-search Experts Exchange using Google in the Firefox browser. This eliminates the need to type out site:experts-exchange.com whenever you want to search the site. Launch your Bookmark Menu: Press 'Ctrl +…

726 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