Solved

About space -again-URGENT

Posted on 2003-11-29
4
187 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now