Home > Net >  Aligning elements to the extreme ends
Aligning elements to the extreme ends

Time:12-02

I'm having trouble aligning elements to the right most and the left most end of the screen. The left part has the logo and the right has an image. Any help would be appreciated

CodePudding user response:

Add css below to the left part

float: left
display: inline-block

and add below css to right part

float: right
display: inline-block

CodePudding user response:

Use flex, If both must be in the same direction.

First put the logo and then the image in a container(e.g div).

Then set this css for container:

display: flex;
justify-content: space-between;

CodePudding user response:

You can also add below code to the parent element.

#parent{
    display: flex;
    align-items: center;
    justify-content: space-between;
}
  • Related