Solved

About space -again-URGENT

Posted on 2003-11-29
4
186 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

762 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

9 Experts available now in Live!

Get 1:1 Help Now