<p> tag not creating new lines

Discussion in 'HTML & Website Design' started by X.Homer.X, Mar 8, 2008.

  1. #1
    Is it possible for a <p> tag to not create a new line? i have this code on my page

    
    <form action="/forum/ucp.php?mode=login" method="post" enctype="multipart/form-data">
    <p>Username:</p>
    <input name="username" id="user" class="username" type="text" border: 1px solid #339900; background-image: url('images/form_bg.gif'); background-repeat: repeat; background-attachment: scroll; background-position: center" />
    <br /><p>Password:</p>
    <input name="password" id="pass" class="password" type="password" border: 1px solid #339900; background-image: url('images/form_bg.gif'); background-repeat: repeat; background-attachment: scroll; background-position: center" /><br />
    <p>Remember me?</p> <input type="checkbox" name="autologin" id="autologin" style="width:14px;" />
    <input type="hidden" name="redirect" value="/index2.php">
    <input name="login" id="submit" value="Login" type="submit" />
    </form>
    <a href="/forum/ucp.php?mode=register"><p>Register?</p></a></p></center>
    
    Code (markup):
    and it makes new lines after all the <p></p>'s my site is as follows

    http://soldiersoffortune.darkstargamers.com/index2.php

    I want the "Username" and "Password" texts to be in line with the fields. Also, i had other input fields with backgrounds, but i tried using the same code for these inputs and it didnt work.

    If anyone could help with either or both of my problems it would be greatly appreciated

    Thanks in advance :)
     
    X.Homer.X, Mar 8, 2008 IP
  2. Dougy

    Dougy Peon

    Messages:
    296
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Have you tried just putting a break tag in?

    The CSS may be causing it.
     
    Dougy, Mar 8, 2008 IP
  3. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    i mean, it DOES create a break, when i dont want it to. i want it to be in line with the input fields (look at my site, they're on a new line)
     
    X.Homer.X, Mar 8, 2008 IP
  4. Dougy

    Dougy Peon

    Messages:
    296
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Oh, leave it to me to misread. I would add a style="" to the <p> tag. I'm pretty sure you can do it.
     
    Dougy, Mar 8, 2008 IP
  5. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #5
    Use p's only for paragraphs. Use <label> instead.
     
    blueparukia, Mar 8, 2008 IP
  6. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    would i do the same thing in my css? like

    
    label {
      font-size: 11px;
      font-family: arial;
      color: #FFFFFF;
      padding-left: 20px;
    }
    
    Code (markup):
    or can i do that with label?
     
    X.Homer.X, Mar 8, 2008 IP
  7. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #7
    Yeah, that's fine. You can even specify which input the label is for, eg:

    
    <label for="password">Password: </label>
    <input name="password" type="text" />
    
    Code (markup):
    You can do what you want with the label's CSS.....
     
    blueparukia, Mar 8, 2008 IP
  8. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    okay, but i have another question, instead of a login button that i click, can i make this text? so like, when they enter their username and password, they click a LINK that says login?
     
    X.Homer.X, Mar 8, 2008 IP
  9. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #9
    Yeah, but it requires Javascript. Just style the submit button so t has no border, background color, and the text is the colour you want. Use the :hover pseudo element to make it change on hover.
     
    blueparukia, Mar 8, 2008 IP
  10. X.Homer.X

    X.Homer.X Peon

    Messages:
    290
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #10
    and how ecactly would i go about doing that? sorry, dont really know how to style buttons..
     
    X.Homer.X, Mar 8, 2008 IP