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
Solved

Right aligning icons

Posted on 2012-12-20
9
220 Views
Last Modified: 2012-12-20
Can anyone see why the two icons (top left) here http://bit.ly/VdKeva are not right aligned?

They are enclosed in div id="horizontalAlign" but have jump out of that container div.
0
Comment
Question by:brettr
  • 5
  • 3
9 Comments
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38712022
They look right aligned.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38712024
Ooops, I meant they look left aligned.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38712036
Find where you have this line in your css, ".social-sprite .spriteleft, .social-sprite .spriteright"

and change it to below.  

.social-sprite .spriteleft, .social-sprite .spriteright {
      margin: 0;
      padding: 0;
      float: right;
}

I would probably even go further and split left and right

.social-sprite .spriteright {
      margin: 0;
      padding: 0;
      float: right;
}
.social-sprite .spriteleft{
      margin: 0;
      padding: 0;
      float: left;
}
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

Author Comment

by:brettr
ID: 38712056
Perfect.  Thanks.  

One more thing, is it possible to add padding or margin top so there is a small buffer under the horizontal line.

I did add

margin: 10 0 0 0;

But it looks like...

* {
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0;
    padding-bottom: 0;
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
}

Open in new window

...is overriding it.
0
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 38712067
try

margin: 10px 0px 0px 0px;

Or 4 different

margin-top:100px;
margin-bottom:0px;
margin-right:0px;
margin-left:0px;

refer
http://www.w3schools.com/css/css_margin.asp
0
 
LVL 52

Accepted Solution

by:
Scott Fell,  EE MVE earned 500 total points
ID: 38712068
If you attach it to a class or id it should work.  


.social-sprite .spriteright {
      margin-top: 20px;
      padding: 10px;
      float: right;
}
0
 

Author Closing Comment

by:brettr
ID: 38712077
Nice.  I went with this:

.social-sprite .spriteright {
      margin-top: 10px;
      padding: 0;
      float: right;
}

For the margins, why wasn't it necessary to set left, right, and bottom?
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 38712092
Leaving something blank is the same as setting it to the default property.  http://www.w3.org/TR/CSS21/propidx.html or a previously set property.   The object is to have the least amount of code possible not the more.
0
 

Author Comment

by:brettr
ID: 38712097
Super.  Thanks again.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
replica website 2 35
Css regex 6 38
Hiding Adsense on Mobile Devices 2 28
output of netstat -r in Powersshell HTML 3 21
An enjoyable and seamless user experience can go a long way on an eCommerce site. While a cohesive layout and engaging copy play roles in creating a positive user experience, some sites neglect aspects that seem marginal but in actuality prove very …
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
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

840 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