SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: labels in a div

  1. #1
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    labels in a div

    Label : some value <-----some gap-----> Label: another value.



    please tell how to code this in HTML ?

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Your question is a bit vague, but remember that "gaps" etc. are a visual thing, and thus are a job for CSS, not HTML.

    In your HTML, just place two labels. E.g.

    Code:
    <label for="name">Your Name</label>
    <label for="email">Your Email</label>
    By default, they will sit side by side; and if you want a gap between them, you could give the first a right margin.

  3. #3
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ralph.m View Post
    Your question is a bit vague, but remember that "gaps" etc. are a visual thing, and thus are a job for CSS, not HTML.

    In your HTML, just place two labels. E.g.

    Code:
    <label for="name">Your Name</label>
    <label for="email">Your Email</label>
    By default, they will sit side by side; and if you want a gap between them, you could give the first a right margin.
    Is it same if instead I give the second a left margin ? can I do this way ? any issue with this ?

  4. #4
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,299
    Mentioned
    460 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by windowsxp View Post
    Is it same if instead I give the second a left margin ? can I do this way ? any issue with this ?
    That's fine too.

  5. #5
    SitePoint Addict
    Join Date
    Dec 2009
    Posts
    302
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks


Bookmarks

Posting Permissions

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