Solved

Right aligning icons

Posted on 2012-12-20
9
221 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
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Google Tag Manager - Add Trigger Using Div class 22 50
bootstrap wrap text 1 30
Html split(text) 2 25
How to pass values to HTML-5 attribute dynamically? 24 43
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

679 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