Jump to content

Alignment in CSS

stefanmz
Go to solution Solved by tikker,
float: right;

perhaps from my very limited HTML/CSS endeavours?

Hey,just wondering if something(some block element) is on the left side of the page and I want to move it to the right is there a better way than margin:1400px for example because that seems kinda janky I don't know,is there something that I can say align to the right side of the page and it instantly goes there without having to move thousands of pixels?

 

Link to comment
Share on other sites

Link to post
Share on other sites

float: right;

perhaps from my very limited HTML/CSS endeavours?

Crystal: CPU: i7 7700K | Motherboard: Asus ROG Strix Z270F | RAM: GSkill 16 GB@3200MHz | GPU: Nvidia GTX 1080 Ti FE | Case: Corsair Crystal 570X (black) | PSU: EVGA Supernova G2 1000W | Monitor: Asus VG248QE 24"

Laptop: Dell XPS 13 9370 | CPU: i5 10510U | RAM: 16 GB

Server: CPU: i5 4690k | RAM: 16 GB | Case: Corsair Graphite 760T White | Storage: 19 TB

Link to comment
Share on other sites

Link to post
Share on other sites

The best option depends on the case but using float is one of them.

Yout could even use "text-align: right;" depending on the elements.

Link to comment
Share on other sites

Link to post
Share on other sites

36 minutes ago, tikker said:

float: right;

perhaps from my very limited HTML/CSS endeavours?

 

28 minutes ago, bredy said:

The best option depends on the case but using float is one of them.

Yout could even use "text-align: right;" depending on the elements.

yeah you are both correct float works,thanks! 

Link to comment
Share on other sites

Link to post
Share on other sites

Just using the words "alignment" and "css" in the same sentence is giving me flashbacks.  That crap has given me trauma.

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, JacobFW said:

Just using the words "alignment" and "css" in the same sentence is giving me flashbacks.  That crap has given me trauma.

oh yeah I feel you! it´s horrible!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×