Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2011
    Posts
    143
    Thanks
    3
    Thanked 1 Time in 1 Post

    Quick question about alignment

    Hey all,

    I am currently trying to get paragraphs to display horizontally rather than vertically

    This is my code

    Code:
    <div id="login-reg">
    <p>Contact</p>
    <p>Login / Register </p>
    <p>Cart</p>
    </div>
    They display like this:

    Contact
    Login / Register
    Cart

    and I want them to display like this:

    Contact Login / Register Cart

    How do I do that?
    I thought it would be

    Code:
    #login-reg {
    display: inline;
    }
    I am wrong though what's new

  • #2
    Regular Coder
    Join Date
    Apr 2011
    Posts
    143
    Thanks
    3
    Thanked 1 Time in 1 Post
    I don't have enough faith in myself :/
    I forgot the p so now it works

    lol this is what it's suppose to be

    #login-reg p {
    display: inline;
    }


    Thanks anyways lol

  • #3
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,302
    Thanks
    28
    Thanked 276 Times in 270 Posts
    Quote Originally Posted by dazd View Post
    This is my code

    Code:
    <div id="login-reg">
    <p>Contact</p>
    <p>Login / Register </p>
    <p>Cart</p>
    </div>
    Worth noting that the following structure makes more sense:

    Code:
    <ul id="login-reg">
    	<li>Contact</li>
    	<li>Login / Register</li>
    	<li>Cart</li>
    </ul>
    Or perhaps the following if you're using HTML5:

    Code:
    <nav id="login-reg">
    	<ul>
    		<li>Contact</li>
    		<li>Login / Register</li>
    		<li>Cart</li>
    	</ul>
    </nav>
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •