user3204934 user3204934 - 1 year ago 113
CSS Question

Move logo to right

I am trying to move logo to right but it doesn't move.


<div class="ui fixed stackable borderless blue inverted menu grid">

<div class="item three wide column">
<img src="" class="logoright">

<div class="item ui search eight wide column">
<div class="ui icon input">
<input class="prompt" placeholder="Common passwords..." type="text">
<i class="search icon"></i>
<div class="results"></div>


.logoright {
text-align: right !important;

I have also checked
ui small right floated image
right aligned
but no one seems to be working.

I want to move image to the left-most of search bar NOT at the end of the nav bar.

Answer Source

You can just do this:

.logoright {
  margin-right: 0px !important;
  margin-left: auto !important;

Fixed jsFiddle

The !importants are needed because your .item>img:not(.ui) selector is setting the margin and it's a more specific selector so it overrides the .logoright selector. If you specified an id for the img, and used that as your selector you could avoid the !importants completely. Might make more sense if you're only going to use this on a menu-bar.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download