Solved

About space -again-URGENT

Posted on 2003-11-29
4
191 Views
Last Modified: 2010-04-09
hi,
 In order to have this:
 
      Username:________
      Password:________

i use this:
<!--
form  {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      color: #000000;
      }

label {
      float: left;
      width:220px;
      clear:all;
      padding-left:80px;

      }


//-->
</style>


My problem is i need  something like this

            Username:________
            Password:________
                         
                           HouseNo1:___________
                                          HouseNo2:______________


How do i do,pls help?
0
Comment
Question by:Jasbir21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 31

Accepted Solution

by:
seanpowell earned 50 total points
ID: 9842236
You can adjust this to suit your needs, but this is the basic styling:

<html>
<head>
<title>Hello</title>
<style type="text/css">
<!--
form  {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      color: #000000;
      }

input {
      width: 100px;
      }

label {
      float: left;
      width:100px;
      clear:all;
      padding-left:30px;
      }
   
//-->
</style>
</head>
<body>
<form>
<label for="username">Username:</label> <input type="text" name="username"><br />
<label for="password">Password:</label> <input type="text" name="password"><br />
<div style="width:100px; height:30px; float:left; padding:0px;"></div><span style="width:100px;">HouseNo1:</span> <input type="text" sixe="10" name="HouseNo1"><br />
<div style="width:204px; height:30px; float:left; clear:left;"></div><span style="width:100px;">HouseNo2:</span> <input type="text" sixe="10" name="HouseNo2"><br />
</form>
</body>
</html>
0
 

Author Comment

by:Jasbir21
ID: 9844364
thanks,i really panic, with the space.

Pls don't mind me asking something why put clear left; or clear=all;

and when put :

<div style="width:204px; height:30px; float:left; clear:left;"></div><span style="width:100px;">HouseNo2:</span>

if put div, then why span?

Very sorry me asking.

thanks
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 9844980
No problem at all...

With the div and the span - the clear:left just makes sure that the "HouseNo2" line sits below the "HouseNo1" line. It means that the left edge of the div must be against the page margin (Their can't be anything to the left of it, so it simply moves down one line) clear:all will also do this, but since there's nothing on the right of it, clear:left will take care of it.

Here's the same form with background colors added to help you see what's happening:

<html>
<head>
<title>Hello</title>
<style type="text/css">
<!--
form  {
      font-family: Arial, Helvetica, sans-serif;
      font-size: 14px;
      color: #000000;
      }

input {
      width: 100px;
      }

label {
      float: left;
      width:100px;
      padding-left:30px;
      background-color: #CCCCCC;
      }
   
//-->
</style>
</head>
<body>
<form>
<label for="username">Username:</label> <input type="text" name="username"><br />
<label for="password">Password:</label> <input type="text" name="password"><br />
<div style="width:100px; height:30px; float:left; padding:0px; background-color: #CCCCCC;"></div><span style="width:100px; background-color: #CCCCCC;">HouseNo1:</span> <input type="text" sixe="10" name="HouseNo1"><br />
<div style="width:204px; height:30px; float:left; clear:all; background-color: #CCCCCC;"></div><span style="width:100px; background-color: #CCCCCC;">HouseNo2:</span> <input type="text" sixe="10" name="HouseNo2"><br />
</form>
</body>
</html>

Play around with adding and removing parts of the code to soo how each attribute affects its layout.

Please feel free to comment back :-)

Thanks,
georgemarian
0
 

Author Comment

by:Jasbir21
ID: 9845318
hi,
  thank you so much, you have really made me understand what it means. I just want to say that i am very very grateful and thankful for being very very patient with me and really helping me to understand.
 
  May God bless you in everything that you do ..

Thank you again and God bless you.
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question