Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Right Aligning Text with CSS

HTML

<body>
        <div class="menu_items">
            <h1>My Heading</h1>
            <nav>
                <a>Item 1</a>
                <a>Item 2</a>
                <a>Item 3</a>
                <a>Item 4</a>
            </nav>
        <div>
</body>

CSS

.menu_items nav a
{
    display: inline;
    margin-right: 10px;
    text-align: right;
}

This does not appear to move the menu_items to the right side of the page. What am I doing wrong?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

One way to achieve that is to move the text-align to .menu_items nav

.menu_items nav {
  text-align: right;
}
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading