Archived

This topic is now archived and is closed to further replies.

  • 0

How to set logo right and social icons left?


Question

Posted · Report post

Hi

 

I am having trouble getting a site logo to sit top right in the header and social icons top left...

 

It -almost- works by setting custom CSS for the logo:

.section-branding .mainlogo-link, .section-branding .mainlogo-img {float:right;}

and then 'branding options - social icons' Distance from the right in pixels to a large value such as 1000 (under 'site options' then 'header and footer')

 

The trouble with this approach is that the icons can be pushed off the edge of screen when narrowing the browser window or on a mobile platform...

 

Far from ideal anyhow. What would be a better way of achieving this?

1 person likes this

Share this post


Link to post
Share on other sites

23 answers to this question

Posted · Report post

Thanks James - Working now!

 

I did have to change one class referenced in your code to move the site logo right-

instead of:

a.site-title {
    display: block;
    float: right;
}

 

I have:

.mainlogo-img {
    display: block;
    float: right;
}

Share this post


Link to post
Share on other sites

Posted · Report post

Hi catpage

Please, you can try with, for example

 

.icons {margin-right: 68em;}
I believe that this is responsive when narrowing the browser window.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Batman, a good idea and a bit better... The social icons do still mess up as the window is narrowed. Initially they 'stack' one above another then slide off the left of screen only to re-appear stuck to the edge of screen at about the point the navbar changes to 'mobile' mode...

 

There must be a way of positioning them so they stay put...?

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there,

 

You can give them absolute positioning.

 

 

.section-branding .icons {     bottom: 50%;     position: absolute !important;     right: 0; }

 

Share this post


Link to post
Share on other sites

Posted · Report post

Hi James

 

I can't get your code to work. Changed to left:0 but still the social icons get positioned at the right of the header pretty much underneath the logo?

Share this post


Link to post
Share on other sites

Posted · Report post

Catpage - could you take a screen shot of what happens when you use James' code please? 

Share this post


Link to post
Share on other sites

Posted · Report post

.section-branding .mainlogo-link, .section-branding .mainlogo-img {float:right;}

.section-branding .icons {     bottom: 50%;     position: absolute !important;     right: 0; }

produces:

 

swapped-header2.png

 

There is no change when substituting right:0 for  left:0

I have tried not using the float:right but have not found an alternative that works.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

If you go to Dashboard > PageLines > Site Options > Header And Footer you can adjust the horizontal position.  Check here on that settings panel:

Branding Section - Social Icon Position

 

Under: Distance From Right (in pixels)

 

Set the value to 800px to test it. That should move the social icons far left, leaving the branding on the right.

Share this post


Link to post
Share on other sites

Posted · Report post

Um, yes... this is where I started this thread; with a value of 1000 moving the social icons left. The thing is this is not a 'responsive' solution as they vanish from the page as the window is sized and I imagine on mobile platforms.

 

More recent posts have been looking for a css based solution (so the 'distance' entry fields to adjust the horizontal position in the panel are empty).

Share this post


Link to post
Share on other sites

Posted · Report post

Most of the custom CSS solutions are not to reposition, but to replace and position unique social icons.  Have you considered just going that route?

Share this post


Link to post
Share on other sites

Posted · Report post

I think you are suggesting disabling the 'default' social icons and coding some custom ones is that correct?  I imagine this should give better control if there is no way of handling the default ones better when they are displayed on the left..

Share this post


Link to post
Share on other sites

Posted · Report post

Okay,

 

I found this CSS:

.section-branding .icons {
    bottom: 50%;
    height: 24px;
    line-height: 20px;
    position: absolute;
    right: 0;
    text-align: right;
}

If I change position to "relative" instead of absolute, and add "float: left;"  then the icon moves flush left in the header.  Ignore, please my other settings as they're custom, most likely, to my site.

Share this post


Link to post
Share on other sites

Posted · Report post

Nope - still no good for me. Looks like the second screengrab above. Icons remaining resolutely on the right under the logo.

 

Perhaps there is an interaction with the way the logo is positioned?

 .section-branding .mainlogo-link, .section-branding .mainlogo-img {float:right;}

Share this post


Link to post
Share on other sites

Posted · Report post

Without seeing a live site, it's impossible to identify if there's some other element affecting this.  It's like trying to perform brain surgery in a dark room with sunglasses on.

Share this post


Link to post
Share on other sites

Posted · Report post

A scary analogy!

 

If you try to reverse social icons and logo on a 'default' site what works for you AND retains fluid layout?

Share this post


Link to post
Share on other sites

Posted · Report post

Excellent, glad you got it working :-)

Share this post


Link to post
Share on other sites

Posted · Report post

Well, that code I gave you was tested and worked with the changes I stated had to be made.  Depending on the size of your branding image, that should align right easily.

 

Yes, it is a scary analogy. But without seeing a live site to check, that's what it is, really. Diagnosis and surgical solutions in the dark. Scary? Frightening! :D

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Rob

 

As I understand it the code you show above sets your social icons to the left.  What code are you using to set the logo to the right?

Share this post


Link to post
Share on other sites

Posted · Report post

I did not do that as you said that was working.

 

If you use Firebug to find these elements, or Chrome's Inspection Tools, that will help you do this much faster and easier:

I found this:

.section-branding .mainlogo-link, .section-branding .mainlogo-img {
    displayblock;
    max-width100%;
}

 

I added:

    floatright;
 

Share this post


Link to post
Share on other sites

Posted · Report post

OK - a bit more digging and it looks like

.section-branding .icons { right:0px; }

in pagelines-compiled-css is the problem.

 

What I need to do is clear this as opposed to override it with another value using inline css which just moves the icons away from the right edge but is not usefully 'responsive'. Not sure how one clears such a declaration and clear:right; is not hacking it...

 

Very surprised though that your approach works Rob as you still have right:0px set above applied to the social icons that need to go left!

Share this post


Link to post
Share on other sites

Posted · Report post

Hi there,

 

I've just gone into the options in Pagelines>site options>header and footer and removed the figures in the admin panel so it was blank and saved. Then checked to see if the inline figures were removed, they were. So added my own css to change the float the and align the icons. The final result I got they stayed within the container when responsive.

 

http://screencast.com/t/fTAbbvZfCB

 

I've only been testing this quickly but the css I used for the layout on my text site is below.

 
a.site-title {
    display: block;
    float: right;
}

.section-branding .icons {
    bottom: 50%;
    float: left !important;
    position: absolute;
    width: 100%;
}

.section-branding .icons a {
  float: left;}

Share this post


Link to post
Share on other sites

Posted · Report post

Hi Catpage - please could we have a link to your site? 

Share this post


Link to post
Share on other sites

Posted · Report post

The site is on a development server and is not yet on a public facing URL.

 

So you can see what I mean here is an annotated screen-grab showing how the logo and social icons have had their positions reversed

 

swapped-header.jpg

Share this post


Link to post
Share on other sites